DigiStamp.com

dgs.tlkt
Class SignedDataA

java.lang.Object
  extended bydgs.tlkt.SignedDataA
Direct Known Subclasses:
CMSTsToken

public abstract class SignedDataA
extends java.lang.Object

This is a Crytographic Message Syntax (CMS) record from IETF RFC 2630. The CMS is also referred to as a PKCS #7 record. This is a common digital signature structure.


Method Summary
 void addPublicKey(java.security.cert.X509Certificate newKey)
          Adds a certificate to the structure.
 byte[] asEncoded()
          This method returns a BER encoded CMS record that contains a Signed Data.
 java.security.cert.X509Certificate[] getCertificates()
          Retrieve the x.509 public key certificates that are contained in the CMS record.
 java.io.InputStream getContent()
          Returns the signed content EncapsulatedContentInfo eContent [0] EXPLICIT OCTET STRING OPTIONAL
 byte[] getContentHash()
          Hash of the content (for a time stamp this is hash of TSTInfo) EncapsulatedContentInfo eContent [0] EXPLICIT OCTET STRING OPTIONAL For signature and "detached content", the user can provide an inputStream & this method returns the hash of the "detached content".
 java.lang.String getContentType()
          Returns the content type.
 dgs.tlkt.SignerInfo[] getSignerInfos()
          Returns the set of contained signer infos.
 java.math.BigInteger getVersion()
          Returns the SignedData.CMSVersion
 boolean removeCertificates()
          Remove all the x.509 public key certificates from the CMS record.
 void removeContent()
          Remove the content from the CMS record.
 boolean removePublicKey(java.security.cert.X509Certificate removeKey)
          Remove a specific x.509 public key certificates from the CMS record.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addPublicKey

public void addPublicKey(java.security.cert.X509Certificate newKey)
                  throws java.security.cert.CertificateEncodingException
Adds a certificate to the structure.

SignedData certificates [0] IMPLICIT CertificateSet OPTIONAL

Throws:
java.security.cert.CertificateEncodingException

asEncoded

public byte[] asEncoded()
                 throws ExceptionDgsInvalidState,
                        ExceptionDgsEncode,
                        java.io.IOException
This method returns a BER encoded CMS record that contains a Signed Data. This could be used, for example, to write the signed data to disk in its encode form.

Throws:
ExceptionDgsInvalidState
ExceptionDgsEncode
java.io.IOException

getCertificates

public java.security.cert.X509Certificate[] getCertificates()
                                                     throws java.security.cert.CertificateEncodingException
Retrieve the x.509 public key certificates that are contained in the CMS record.

SignedData certificates [0] IMPLICIT CertificateSet OPTIONAL

In the case of a time stamp, the DigiStamp server will return the certificates if the TsRequest.setCertRequest(boolean)is set to true. If the CMS record does not contain the certificates then this method will return null. There is potential for there to be multiple certificates to capture the chain of authority for the certificates.

Throws:
java.security.cert.CertificateEncodingException

getContent

public java.io.InputStream getContent()
                               throws java.io.IOException
Returns the signed content

EncapsulatedContentInfo eContent [0] EXPLICIT OCTET STRING OPTIONAL

Throws:
java.io.IOException

getContentHash

public byte[] getContentHash()
                      throws java.io.IOException
Hash of the content (for a time stamp this is hash of TSTInfo)

EncapsulatedContentInfo eContent [0] EXPLICIT OCTET STRING OPTIONAL For signature and "detached content", the user can provide an inputStream & this method returns the hash of the "detached content". If this method calculate the hash of the content then it save the results to avoid recalculation on subsequent calls. Can return null if there is no content

Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Returns the content type.

EncapsulatedContentInfo eContentType ContentType


getSignerInfos

public dgs.tlkt.SignerInfo[] getSignerInfos()
Returns the set of contained signer infos.

SignedData signerInfos SignerInfos


getVersion

public java.math.BigInteger getVersion()
Returns the SignedData.CMSVersion


removeCertificates

public boolean removeCertificates()
Remove all the x.509 public key certificates from the CMS record.

SignedData certificates [0] IMPLICIT CertificateSet OPTIONAL

The next call to asEncoded()will return the CMS encoded without the certificates. You would not normally do this unless you were trying to save storage.

Returns:
boolean true if certificates existed and were removed

removeContent

public void removeContent()
Remove the content from the CMS record.

EncapsulatedContentInfo eContent [0] EXPLICIT OCTET STRING OPTIONAL The next call to asEncoded()will return the CMS encoded without the content. You would not normally do this unless you were trying to save storage or maybe for some other reason. This would be removing the tstInfo from a time stamp and that would make it impossible to verify.


removePublicKey

public boolean removePublicKey(java.security.cert.X509Certificate removeKey)
                        throws java.security.cert.CertificateEncodingException
Remove a specific x.509 public key certificates from the CMS record.

SignedData certificates [0] IMPLICIT CertificateSet OPTIONAL

The next call to asEncoded()will return the CMS encoded without the certificates. You would not normally do this unless you were trying to save storage.

Returns:
boolean true if certificate existed and were removed
Throws:
java.security.cert.CertificateEncodingException

Copyright 2000-2008 DigiStamp, Inc.