com.adobe.livecycle.signatures.client.types
Class Credential

java.lang.Object
  extended by com.adobe.livecycle.signatures.client.types.Credential
All Implemented Interfaces:
java.io.Serializable

public class Credential
extends java.lang.Object
implements java.io.Serializable

Represents a credential that is required to sign or certify a PDF document. You create a Credential object by invoking the getInstance method and referencing a security credential that is located in LiveCycle Credential Service or provide a SPI name (and other properties) for signing the PDF using the SPI signature handler.

Three components make up a credential: certificate, key, and alias. You create an instance of this type when you sign or certify a PDF document. To see an object of this type used in a code example, see the Digitally signing a PDF document using the Java API quick start in Programming with LiveCycle ES4.

See Also:
Sign(), Certify(), Serialized Form

Field Summary
static int ALIAS_CERT_KEY
          This value specifies that the alias is provided from Signature API, the certificate is from the LiveCycle ES trust store.
static int ALIAS_CERTNKEY_NONE
          This value specifies that the alias is provided from Signature API, the certificate and key values are from the LiveCycle ES trust store, and the signing SPI provider is not queried.
static int ALIAS_NONE_CERTNKEY
          This value specifies that the alias is provided from the Signature API, the Truststore is not querried.
static int CERT_NONE_KEY
          This value specifies that the certificate is provided from the Signature API, the LiveCycle ES trust store is not querried, and the key value comes from the signing SPI provider.
static java.lang.String DEFAULT_ALIAS
          This value specifies that the SPI signing provider is used.
 
Constructor Summary
Credential()
           
 
Method Summary
 java.lang.String getAlias()
          Returns the alias corresponding to this Credential object.
 byte[] getCertificate()
          Returns the certificate used when using the signing SPI provider to sign a PDF document.
 int getCredentialType()
          Retrieves the credential type.
static Credential getInstance(byte[] cert, java.lang.String inSpiName)
          Creates a Credential object that is used to sign or certify a PDF document using an SPI provider.
static Credential getInstance(java.lang.String alias)
          Creates a Credential object that is used to sign or certify a PDF document.
 java.lang.String getSpiName()
          Returns the name of the signing SPI provider.
 java.util.HashMap getSPIProperties()
          Gets the property values that are used by the signing SPI provider.
static java.util.Properties hashMapToProperties(java.util.HashMap hmap)
          Converts a java.util.Properties object to a java.util.HashMap object.
static java.util.HashMap propertiesToHashMap(java.util.Properties props)
          Converts a java.util.Properties object to a java.util.HashMap object.
 void setAlias(java.lang.String alias)
          Sets the alias value that corresponds to this Credential object.
 void setCertificate(byte[] certificate)
          Sets the certificate used when using the signing SPI provider to sign a PDF document.
 void setCredentialType(int credentialType)
          Sets the credential type that provide the types of credentials supported and the default value.
 void setSpiName(java.lang.String inSpiName)
          Sets the name of the signing SPI provider.
 void setSPIProperties(java.util.HashMap props)
          Sets the property values that are used by the signing SPI provider.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CERT_NONE_KEY

public static final int CERT_NONE_KEY
This value specifies that the certificate is provided from the Signature API, the LiveCycle ES trust store is not querried, and the key value comes from the signing SPI provider.

See Also:
Constant Field Values

ALIAS_CERTNKEY_NONE

public static final int ALIAS_CERTNKEY_NONE
This value specifies that the alias is provided from Signature API, the certificate and key values are from the LiveCycle ES trust store, and the signing SPI provider is not queried. This is the default value.

See Also:
Constant Field Values

ALIAS_NONE_CERTNKEY

public static final int ALIAS_NONE_CERTNKEY
This value specifies that the alias is provided from the Signature API, the Truststore is not querried. Both the key and certificate values come from the signing SPI provider. This is an unsupported attribute at present.

See Also:
Constant Field Values

ALIAS_CERT_KEY

public static final int ALIAS_CERT_KEY
This value specifies that the alias is provided from Signature API, the certificate is from the LiveCycle ES trust store. Both Kkey and certificate values come from the signing SPI provider. This is an unsupported attribute at present.

See Also:
Constant Field Values

DEFAULT_ALIAS

public static final java.lang.String DEFAULT_ALIAS
This value specifies that the SPI signing provider is used.

See Also:
Constant Field Values
Constructor Detail

Credential

public Credential()
Method Detail

getInstance

public static Credential getInstance(java.lang.String alias)
Creates a Credential object that is used to sign or certify a PDF document. To see this method used in a code example, see the Digitally signing a PDF document using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
alias - The alias of the credential that is located in LiveCycle Credential Service. An alias is specified when you import a security credential.
Returns:
A Credential object that corresponds to the specified alias.

getInstance

public static Credential getInstance(byte[] cert,
                                     java.lang.String inSpiName)
Creates a Credential object that is used to sign or certify a PDF document using an SPI provider. Use of this method with certificate parameter implies the use of the signing SPI provider. This function is used only when calling the signing SPI provider for signing the document. To see how to create a signing SPI provider, see the Creating Signature Handlers section in Programming with LiveCycle ES4.

Parameters:
cert - The byte array corresponding to the certificate required for signing using the signing SPI provider.
inSpiName - The name of the signing SPI provider as registered with the Signature service.
Returns:
A Credential object that corresponds to the specified alias.

propertiesToHashMap

public static java.util.HashMap propertiesToHashMap(java.util.Properties props)
Converts a java.util.Properties object to a java.util.HashMap object.

Parameters:
props - The java.util.Properties object to be converted to a java.util.HashMap object.
Returns:
A java.util.HashMap object that corresponds to the specified alias.

hashMapToProperties

public static java.util.Properties hashMapToProperties(java.util.HashMap hmap)
Converts a java.util.Properties object to a java.util.HashMap object.

Parameters:
props - The java.util.HashMap object to convert to a java.util.Properties object.
Returns:
A java.util.HashMap object that corresponds to the specified alias.

getAlias

public java.lang.String getAlias()
Returns the alias corresponding to this Credential object.

Returns:
The alias corresponding to this Credential object.

setAlias

public void setAlias(java.lang.String alias)
Sets the alias value that corresponds to this Credential object. To see this method used in a code example, see the Digitally signing a PDF document using the Java API quick start in Programming with LiveCycle ES4.

Parameters:
alias - The alias value that corresponds to this Credential object.

getCertificate

public byte[] getCertificate()
Returns the certificate used when using the signing SPI provider to sign a PDF document.

Returns:
cert A byte array corresponding to the certificate required for signing when using the signing SPI provider.

setCertificate

public void setCertificate(byte[] certificate)
Sets the certificate used when using the signing SPI provider to sign a PDF document. To see how to create a signing SPI provider, see the Creating Signature Handlers section in Programming with LiveCycle ES4.

Parameters:
cert - The byte array corresponding to the certificate required when using the signing SPI provider.

getCredentialType

public int getCredentialType()
Retrieves the credential type. Valid credential types are listed as fields in this class.

Returns:
An integer value that specifies the credential type.

setCredentialType

public void setCredentialType(int credentialType)
Sets the credential type that provide the types of credentials supported and the default value.

Parameters:
credentialType - An integer value that specifies the credential type.

getSpiName

public java.lang.String getSpiName()
Returns the name of the signing SPI provider. To see how to create a signing SPI provider, see the Creating Signature Handlers section in Programming with LiveCycle ES4.

Returns:
A string value that specifies the name of the signing SPI provider.

setSpiName

public void setSpiName(java.lang.String inSpiName)
Sets the name of the signing SPI provider. To see how to create a signing SPI provider, see the Creating Signature Handlers section in Programming with LiveCycle ES4.

Parameters:
inSpiName - A string value that specifies the name of the signing SPI provider.

getSPIProperties

public java.util.HashMap getSPIProperties()
Gets the property values that are used by the signing SPI provider. To see how to create a signing SPI provider, see the Creating Signature Handlers section in Programming with LiveCycle ES4.

Returns:
A java.util.Properties object that contains property values used by the signing SPI provider.

setSPIProperties

public void setSPIProperties(java.util.HashMap props)
Sets the property values that are used by the signing SPI provider. These properties are not modified (or parsed) by the Signature service and are passed to the SPI provider as-is.

Parameters:
props - A java.util.Properties object that contains property values used by the signing SPI provider.


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