xades4j.providers
Interface KeyingDataProvider

All Known Implementing Classes:
DirectKeyingDataProvider, FileSystemKeyStoreKeyingDataProvider, KeyStoreKeyingDataProvider, PKCS11KeyStoreKeyingDataProvider

public interface KeyingDataProvider

Used in signature production to get the signing key/certificate.

Author:
Luís
See Also:
XadesSigningProfile

Method Summary
 List<X509Certificate> getSigningCertificateChain()
          Gets the signing certificate chain to be used in an ongoing signature operation.
 PrivateKey getSigningKey(X509Certificate signingCert)
          Gets the signing key that matches a signing certificate.
 

Method Detail

getSigningCertificateChain

List<X509Certificate> getSigningCertificateChain()
                                                 throws SigningCertChainException,
                                                        UnexpectedJCAException
Gets the signing certificate chain to be used in an ongoing signature operation. At least the signing certificate must be present. Other certificates may be present, possibly up to the trust anchor.

Returns:
the signing certificate (chain)
Throws:
SigningCertChainException - if the signing certificate (chain) couldn't be obtained
UnexpectedJCAException - when an unexpected platform error occurs

getSigningKey

PrivateKey getSigningKey(X509Certificate signingCert)
                         throws SigningKeyException,
                                UnexpectedJCAException
Gets the signing key that matches a signing certificate. The certificate supplied to this method is ALWAYS the first of the collection returned in the previous call to getSigningCertificateChain.

Parameters:
signingCert - the certificate for which the corresponding key should be returned
Returns:
the private key that matches signingCert
Throws:
SigningKeyException - if the signing key couldn't be obtained
UnexpectedJCAException - when an unexpected platform error occurs


Copyright © 2012. All Rights Reserved.