public class SignerInformation
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private CMSProcessable |
content |
private DERObjectIdentifier |
contentType |
private AlgorithmIdentifier |
digestAlgorithm |
private AlgorithmIdentifier |
encryptionAlgorithm |
private byte[] |
hash |
private SignerInfo |
info |
private byte[] |
resultDigest |
private SignerId |
sid |
private byte[] |
signature |
private ASN1Set |
signedAttributes |
private ASN1Set |
unsignedAttributes |
| Constructor and Description |
|---|
SignerInformation(SignerInfo info,
DERObjectIdentifier contentType,
CMSProcessable content,
byte[] digest) |
| Modifier and Type | Method and Description |
|---|---|
private DigestInfo |
derDecode(byte[] encoding) |
private boolean |
doVerify(java.security.PublicKey key,
AttributeTable signedAttrTable,
java.lang.String sigProvider) |
private byte[] |
encodeObj(DEREncodable obj) |
byte[] |
getContentDigest()
return the content digest that was calculated during verification.
|
java.lang.String |
getDigestAlgOID()
return the object identifier for the signature.
|
byte[] |
getDigestAlgParams()
return the signature parameters, or null if there aren't any.
|
byte[] |
getEncodedSignedAttributes()
return the DER encoding of the signed attributes.
|
java.lang.String |
getEncryptionAlgOID()
return the object identifier for the signature.
|
byte[] |
getEncryptionAlgParams()
return the signature/encyrption algorithm parameters, or null if
there aren't any.
|
SignerId |
getSID() |
byte[] |
getSignature()
return the encoded signature
|
AttributeTable |
getSignedAttributes()
return a table of the signed attributes - indexed by
the OID of the attribute.
|
byte[] |
getSignedAttributesByte() |
AttributeTable |
getUnsignedAttributes()
return a table of the unsigned attributes indexed by
the OID of the attribute.
|
int |
getVersion()
return the version number for this objects underlying SignerInfo structure.
|
private boolean |
isNull(DEREncodable o) |
static SignerInformation |
replaceUnsignedAttributes(SignerInformation signerInformation,
AttributeTable unsignedAttributes)
Return a signer information object with the passed in unsigned
attributes replacing the ones that are current associated with
the object passed in.
|
SignerInfo |
toSignerInfo()
Return the base ASN.1 CMS structure that this object contains.
|
boolean |
verify(java.security.PublicKey key,
java.lang.String sigProvider)
verify that the given public key succesfully handles and confirms the
signature associated with this signer.
|
boolean |
verify(java.security.cert.X509Certificate cert,
java.lang.String sigProvider)
verify that the given certificate succesfully handles and confirms
the signature associated with this signer and, if a signingTime
attribute is available, that the certificate was valid at the time the
signature was generated.
|
private boolean |
verifyDigest(byte[] digest,
java.security.PublicKey key,
byte[] signature,
java.lang.String sigProvider) |
private SignerId sid
private SignerInfo info
private AlgorithmIdentifier digestAlgorithm
private AlgorithmIdentifier encryptionAlgorithm
private ASN1Set signedAttributes
private ASN1Set unsignedAttributes
private CMSProcessable content
private byte[] signature
private DERObjectIdentifier contentType
private byte[] hash
private byte[] resultDigest
SignerInformation(SignerInfo info, DERObjectIdentifier contentType, CMSProcessable content, byte[] digest)
private byte[] encodeObj(DEREncodable obj) throws java.io.IOException
java.io.IOExceptionpublic SignerId getSID()
public int getVersion()
public java.lang.String getDigestAlgOID()
public byte[] getDigestAlgParams()
public byte[] getContentDigest()
public java.lang.String getEncryptionAlgOID()
public byte[] getEncryptionAlgParams()
public AttributeTable getSignedAttributes()
public byte[] getSignedAttributesByte()
public AttributeTable getUnsignedAttributes()
public byte[] getSignature()
public byte[] getEncodedSignedAttributes()
throws java.io.IOException
java.io.IOException - if an encoding error occurs.private boolean doVerify(java.security.PublicKey key,
AttributeTable signedAttrTable,
java.lang.String sigProvider)
throws CMSException,
java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException
CMSExceptionjava.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionprivate boolean isNull(DEREncodable o)
private DigestInfo derDecode(byte[] encoding) throws java.io.IOException, CMSException
java.io.IOExceptionCMSExceptionprivate boolean verifyDigest(byte[] digest,
java.security.PublicKey key,
byte[] signature,
java.lang.String sigProvider)
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
CMSException
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionCMSExceptionpublic boolean verify(java.security.PublicKey key,
java.lang.String sigProvider)
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
CMSException
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionCMSExceptionpublic boolean verify(java.security.cert.X509Certificate cert,
java.lang.String sigProvider)
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
java.security.cert.CertificateExpiredException,
java.security.cert.CertificateNotYetValidException,
CMSException
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionjava.security.cert.CertificateExpiredExceptionjava.security.cert.CertificateNotYetValidExceptionCMSExceptionpublic SignerInfo toSignerInfo()
public static SignerInformation replaceUnsignedAttributes(SignerInformation signerInformation, AttributeTable unsignedAttributes)
signerInformation - the signerInfo to be used as the basis.unsignedAttributes - the unsigned attributes to add.Copyright © 1998-2014 Gamma Technologies. All Rights Reserved.