com.adobe.flashaccess.sdk.cert
Class ServerCredentialFactory

java.lang.Object
  extended by com.adobe.flashaccess.sdk.cert.ServerCredentialFactory

public class ServerCredentialFactory
extends java.lang.Object

Utilities for getting instances of ServerCredential.


Constructor Summary
ServerCredentialFactory()
           
 
Method Summary
static ServerCredential getServerCredential(java.io.File pfxFile, java.lang.String password)
          Creates a ServerCredential from a PKCS12 file containing the certificate and private key.
static ServerCredential getServerCredential(java.io.InputStream pfxInputStream, java.lang.String password)
          Creates a ServerCredential from a PKCS12 file containing the certificate and private key.
static ServerCredential getServerCredential(java.security.PrivateKey privateKey, java.security.cert.Certificate certificate)
          Creates a ServerCredential for the given private key and certificate.
static ServerCredential getServerCredential(java.security.PrivateKey privateKey, java.security.cert.Certificate[] chain)
          Creates a ServerCredential for the given private key and certificate chain.
static ServerCredential getServerCredential(java.security.PrivateKey privateKey, java.security.cert.Certificate[] chain, java.lang.String provider)
          Creates a ServerCredential for the given private key and certificate chain.
static ServerCredential getServerCredential(java.security.PrivateKey privateKey, java.security.cert.Certificate certificate, java.lang.String provider)
          Creates a ServerCredential for the given private key and certificate.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerCredentialFactory

public ServerCredentialFactory()
Method Detail

getServerCredential

public static ServerCredential getServerCredential(java.security.PrivateKey privateKey,
                                                   java.security.cert.Certificate[] chain)
                                            throws ServerCredentialException
Creates a ServerCredential for the given private key and certificate chain. This constructor must not be used for private keys stored on an HSM.

Parameters:
privateKey - The private key.
chain - The certificate chain. The first element in the array must be the certificate corresponding to the private key.
Returns:
The server credential.
Throws:
ServerCredentialException - if the certificate is not valid or expired.
java.lang.IllegalArgumentException - if the arguments are not valid as described in java.security.KeyStore.PrivateKeyEntry.

getServerCredential

public static ServerCredential getServerCredential(java.security.PrivateKey privateKey,
                                                   java.security.cert.Certificate certificate)
                                            throws ServerCredentialException
Creates a ServerCredential for the given private key and certificate. This constructor must not be used for private keys stored on an HSM.

Parameters:
privateKey - The private key.
certificate - The certificate corresponding to the private key.
Returns:
The server credential.
Throws:
ServerCredentialException - if the certificate is not valid or expired.
java.lang.IllegalArgumentException - if the arguments are not valid as described in java.security.KeyStore.PrivateKeyEntry.

getServerCredential

public static ServerCredential getServerCredential(java.io.File pfxFile,
                                                   java.lang.String password)
                                            throws ServerCredentialException
Creates a ServerCredential from a PKCS12 file containing the certificate and private key.

Parameters:
pfxFile - The .pfx file containing the credentials.
password - The password to recover the key from the file.
Returns:
The signing credential.
Throws:
InvalidServerCredentialException - if the certificate is not valid.
ServerCredentialException - if there is a problem loading the certificate from the file, the password is incorrect, or the certificate is not valid or expired.
java.lang.IllegalArgumentException - if the arguments are not valid as described in java.security.KeyStore.PrivateKeyEntry.

getServerCredential

public static ServerCredential getServerCredential(java.io.InputStream pfxInputStream,
                                                   java.lang.String password)
                                            throws ServerCredentialException
Creates a ServerCredential from a PKCS12 file containing the certificate and private key.

Parameters:
pfxInputStream - The pfx InputStream containing the credentials.
password - The password to recover the key from the file.
Returns:
The signing credential.
Throws:
InvalidServerCredentialException - if the certificate is not valid.
ServerCredentialException - if there is a problem loading the certificate from the file, the password is incorrect, or the certificate is not valid or expired.
java.lang.IllegalArgumentException - if the arguments are not valid as described in java.security.KeyStore.PrivateKeyEntry.

getServerCredential

public static ServerCredential getServerCredential(java.security.PrivateKey privateKey,
                                                   java.security.cert.Certificate[] chain,
                                                   java.lang.String provider)
                                            throws ServerCredentialException
Creates a ServerCredential for the given private key and certificate chain. This constructor must be used for private keys stored on an HSM.

Parameters:
privateKey - The private key.
chain - The certificate chain. The first element in the array must be the certificate corresponding to the private key.
provider - The name of a registered java.security.Provider used to load the PrivateKey (for example, "PKCS11" for sun.security.pkcs11.SunPKCS11)
Returns:
The server credential.
Throws:
ServerCredentialException - if the certificate is not valid or expired.
java.lang.IllegalArgumentException - if the arguments are not valid as described in java.security.KeyStore.PrivateKeyEntry.

getServerCredential

public static ServerCredential getServerCredential(java.security.PrivateKey privateKey,
                                                   java.security.cert.Certificate certificate,
                                                   java.lang.String provider)
                                            throws ServerCredentialException
Creates a ServerCredential for the given private key and certificate. This constructor must be used for private keys stored on an HSM.

Parameters:
privateKey - The private key.
certificate - The certificate corresponding to the private key.
provider - The name of a registered java.security.Provider used to load the PrivateKey (for example, "PKCS11" for sun.security.pkcs11.SunPKCS11)
Returns:
The server credential.
Throws:
ServerCredentialException - if the certificate is not valid or expired.
java.lang.IllegalArgumentException - if the arguments are not valid as described in java.security.KeyStore.PrivateKeyEntry.


[an error occurred while processing this directive] [an error occurred while processing this directive]