public class CredentialFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static PrivateKeyHolder |
computeJCEPrivateKey(PrivateKeyHolder privateKeyHolder) |
Credentials |
createCredentials(byte[] derEncodedPrivateKey,
byte[] derEncodedCert,
byte[][] derEncodedCertChain)
Create a new instance of a
Credentials object from der encoded bytes representing a private key, certificate, certificate chain. |
Credentials |
createCredentials(KeyStore keyStore,
String alias,
char[] password)
This method should not be used except for internal testing.
|
Credentials |
createCredentials(PrivateKeyHolder privateKeyHolder,
byte[] derEncodedCert,
byte[][] derEncodedCertChain)
Create a new instance of a
Credentials object from a private key holder and bytes representing a DER encoded certificate
and certificate chain. |
Credentials |
createCredentials(PrivateKeyHolder privateKeyHolder,
X509Certificate cert,
Certificate[] certChain)
Create a new instance of a
Credentials object from a PrivateKeyHolder, an explicit certificate
and certificate chain. |
Credentials |
createCredentials(PrivateKey privateKey,
X509Certificate cert,
Certificate[] certChain)
Create a new instance of a
Credentials object from a java private key, cert and certificate chain. |
Credentials |
createEncryptionCredentials(byte[] derEncodedCert,
byte[][] derEncodedCertChain)
Create a new instance of a
Credentials object for Encryption
from the bytes representing a DER encoded certificate
and certificate chain. |
static String |
getJCEProviderName(PrivateKeyHolder privateKeyHolder) |
static CredentialFactory |
newInstance() |
public static CredentialFactory newInstance()
public Credentials createCredentials(PrivateKeyHolder privateKeyHolder, X509Certificate cert, Certificate[] certChain) throws PDFInvalidParameterException
Credentials object from a PrivateKeyHolder, an explicit certificate
and certificate chain.privateKeyHolder - - A container for a private key. It can be be generated using the PrivateKeyHolderFactory.cert - - An X509 certificatecertChain - - An array of certificates in the certificate chain.CredentialsPDFInvalidParameterExceptionpublic Credentials createCredentials(PrivateKey privateKey, X509Certificate cert, Certificate[] certChain) throws PDFInvalidParameterException
Credentials object from a java private key, cert and certificate chain.privateKey - - JCE private keycert - - an X509 CertificatecertChain - - an array of certificatesCredentialsPDFInvalidParameterExceptionpublic Credentials createCredentials(byte[] derEncodedPrivateKey, byte[] derEncodedCert, byte[][] derEncodedCertChain) throws PDFInvalidParameterException
Credentials object from der encoded bytes representing a private key, certificate, certificate chain.
You cannot use this method if your signature algorithm is DSA.
If signature algorithm is DSA use -
public Credentials createCredentials(PrivateKeyHolder privateKeyHolder, byte[] derEncodedCert, byte[][] derEncodedCertChain)derEncodedPrivateKey - - byte array representing a DER encoded PKCS8 unencrypted private keyderEncodedCert - - byte array representing a DER encoded X509 certificatederEncodedCertChain - - array of byte arrays representing a DER encoded certificate chain.CredentialsPDFInvalidParameterExceptionpublic Credentials createCredentials(PrivateKeyHolder privateKeyHolder, byte[] derEncodedCert, byte[][] derEncodedCertChain) throws PDFInvalidParameterException
Credentials object from a private key holder and bytes representing a DER encoded certificate
and certificate chain.privateKeyHolder - - A container for a private key. It can be be generated using the PrivateKeyHolderFactory.derEncodedCert - - byte array representing a DER encoded X509 certificatederEncodedCertChain - - array of byte arrays representing a DER encoded certificate chain.CredentialsPDFInvalidParameterExceptionpublic Credentials createEncryptionCredentials(byte[] derEncodedCert, byte[][] derEncodedCertChain) throws PDFInvalidParameterException
Credentials object for Encryption
from the bytes representing a DER encoded certificate
and certificate chain.
This Credentials object may be used for encryption only. It may not be used for
decryption or Digital Signatures processing.
This method may not be used on JDK 1.4.2 with public key length greater than 2048.
derEncodedCert - - byte array representing a DER encoded X509 certificatederEncodedCertChain - - array of byte arrays representing a DER encoded certificate chain.CredentialsPDFInvalidParameterExceptionpublic Credentials createCredentials(KeyStore keyStore, String alias, char[] password) throws PDFInvalidParameterException
Credentials object from a keystore entry.
This method is synchronized because the underlying KeyStore may not be thread safe.keyStore - the keystore containing the certificate and certificate chain.alias - the alias (or name) of the entry within the keystore containing the
certificate and certificate chain.password - the password for recovering the key.CredentialsPDFInvalidParameterException - if any of the input parameters specify an invalid or
inaccessible entity.public static PrivateKeyHolder computeJCEPrivateKey(PrivateKeyHolder privateKeyHolder) throws NoSuchAlgorithmException, InvalidKeySpecException, PDFInvalidParameterException
public static String getJCEProviderName(PrivateKeyHolder privateKeyHolder)
Copyright © 2010 - 2020 Adobe. All Rights Reserved