Bouncy Castle Cryptography Library 1.85

org.bouncycastle.cms
Class SignerInfoGenerator

java.lang.Object
  extended byorg.bouncycastle.cms.SignerInfoGenerator

public class SignerInfoGenerator
extends java.lang.Object


Constructor Summary
SignerInfoGenerator(SignerInfoGenerator original, CMSAttributeTableGenerator sAttrGen, CMSAttributeTableGenerator unsAttrGen)
           
 
Method Summary
 org.bouncycastle.asn1.cms.SignerInfo generate(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType)
           
 X509CertificateHolder getAssociatedCertificate()
           
 byte[] getCalculatedDigest()
           
 java.io.OutputStream getCalculatingOutputStream()
           
 org.bouncycastle.asn1.x509.AlgorithmIdentifier getDigestAlgorithm()
           
 int getGeneratedVersion()
           
 long getPredictedEncodedLength(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType)
          Return the exact encoded length of the SignerInfo this generator will produce for the given content type, or -1 when it cannot be predicted.
 org.bouncycastle.asn1.cms.SignerIdentifier getSID()
           
 CMSAttributeTableGenerator getSignedAttributeTableGenerator()
           
 CMSAttributeTableGenerator getUnsignedAttributeTableGenerator()
           
 boolean hasAssociatedCertificate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignerInfoGenerator

public SignerInfoGenerator(SignerInfoGenerator original,
                           CMSAttributeTableGenerator sAttrGen,
                           CMSAttributeTableGenerator unsAttrGen)
Method Detail

getSID

public org.bouncycastle.asn1.cms.SignerIdentifier getSID()

getGeneratedVersion

public int getGeneratedVersion()

hasAssociatedCertificate

public boolean hasAssociatedCertificate()

getAssociatedCertificate

public X509CertificateHolder getAssociatedCertificate()

getDigestAlgorithm

public org.bouncycastle.asn1.x509.AlgorithmIdentifier getDigestAlgorithm()

getCalculatingOutputStream

public java.io.OutputStream getCalculatingOutputStream()

generate

public org.bouncycastle.asn1.cms.SignerInfo generate(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType)
                                              throws CMSException
Throws:
CMSException

getPredictedEncodedLength

public long getPredictedEncodedLength(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType)
Return the exact encoded length of the SignerInfo this generator will produce for the given content type, or -1 when it cannot be predicted.

Prediction requires the underlying ContentSigner to implement FixedLengthContentSigner and, where attribute generators are present, that they produce attribute sets whose encoded length does not depend on the values supplied at signing time. The default CMS signed-attribute table qualifies: the messageDigest value's length is fixed by the digest algorithm and signingTime is a fixed-width UTCTime (until 2050). Definite-length consumers verify the eventual SignerInfo against this prediction, so a length-unstable attribute generator fails at generation time rather than silently corrupting output.


getCalculatedDigest

public byte[] getCalculatedDigest()

getSignedAttributeTableGenerator

public CMSAttributeTableGenerator getSignedAttributeTableGenerator()

getUnsignedAttributeTableGenerator

public CMSAttributeTableGenerator getUnsignedAttributeTableGenerator()

Bouncy Castle Cryptography Library 1.85