|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.pkcs7.SignerInfo
This class defines the SignerInfo
structure that represents
per-signer information.
SignerInfo ::= SEQUENCE { version Version, issuerAndSeralNumber IssuerAndSerialNumber, digestAlgorithm DigestAlgorithmIdentifier, authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL, digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier, encryptedDigest EncryptedDigest, unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL } Version ::= INTEGER -- a syntax version number EncryptedDigest ::= OCTET STRING IssuerAndSerialNumber ::= SEQUENCE { issuer Name, serialNumber CertificateSerialNumber } -- identifies a certificate (and thereby an entity and a public key) by the distinguished name of the certificate issuer and an issuer-specific certificate serial number. DigestAlgorithmIdentifier ::= AlgorithmIdentifier -- a message-digest algorithm. DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier -- a digest-encryption algorithm under which a message digest can be encrypted. |
authenticatedAttributes
field is a set
of attributes that are signed (that is, authenticated) by
the signer. This field is optional; however, it must be
present if the content type of the
ContentInfo
value being signed is not
Data
.
If the authenticatedAttributes
field is
present, it must contain, at a minimum, two attributes:
ContentInfo
value
being signed.
unauthenticatedAttributes
is a set of
attributes that are not signed (that is,
unauthenticated) by the signer. This field is
optional. Attribute types that might be useful here,
such as countersignatures
, are defined in
PKCS #9.
See Also
Constructor Summary |
|
SignerInfo()
Constructs an empty |
Method Summary |
|
clone()
Overrides the default |
|
boolean |
equals(Object obj)
Returns |
getAuthenticatedAttrs()
Gets the authenticated attributes. |
|
getDigestAlgorithmName()
Gets the digest algorithm name. |
|
byte[] |
getDigestAlgorithmOID()
Gets the digest algorithm identifier. |
byte[] |
getEncryptedDigest()
Gets the encrypted digest. |
getEncryptionAlgorithmName()
Gets the digest-encryption algorithm name. |
|
byte[] |
getEncryptionAlgorithmOID()
Gets the digest-encryption algorithm identifier. |
byte[] |
getIssuerAndSerialNumber()
Gets the issuer name and serial number as a single entity. |
getIssuerName()
Gets the issuer name of the signer's certificate. |
|
byte[] |
getSerialNumber()
Gets the serial number of the signer's certificate. |
getUnauthenticatedAttrs()
Gets the unauthenticated attributes. |
|
int |
getVersionNumber()
Gets the version number. |
void |
setAuthenticatedAttrs(X501Attributes attrs)
Sets authenticated attributes. |
void |
setDigestAlgorithm(byte[] digestOID,
int offset,
int len)
Sets the digest algorithm identifier. |
void |
setDigestAlgorithm(String algName)
Sets the digest algorithm identifier. |
void |
setEncryptionAlgorithm(byte[] encryptOID,
int offset,
int len)
Sets the digest-encryption algorithm identifier. |
void |
setEncryptionAlgorithm(String algName)
Sets the digest-encryption algorithm identifier; for
example; |
void |
setIssuerAndSerialNumber(X500Name name,
byte[] number,
int offset,
int length)
Sets the issuer and serial number that specifies the signer's certificate. |
void |
setUnauthenticatedAttrs(X501Attributes attrs)
Sets the unauthenticated attributes. |
void |
setVersionNumber(int version)
Sets the version number. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SignerInfo()
SignerInfo
object.Method Detail |
public void setVersionNumber(int version)
Parameters
version | The version number to set. |
public int getVersionNumber()
Returns
public void setIssuerAndSerialNumber(X500Name name, byte[] number, int offset, int length) throws PKCS7Exception
Parameters
issuer | An | ||
number | A | ||
offset | The offset into the number array. | ||
length | The length of the data in the number array. |
Throws
PKCS7Exception
- If there is an error
in setting the issuer and serial number or
the values are null
.public X500Name getIssuerName() throws PKCS7Exception
Returns
X500Name
object that contains
a copy of the issuer distinguished name.
Throws
PKCS7Exception
- If there is an error getting a
copy of the issuer distinguished name.public byte[] getSerialNumber()
Returns
byte
array that contains
the issuer-specific serial number.public byte[] getIssuerAndSerialNumber() throws PKCS7Exception
byte
array.
This array contains the DER encoding of the following ASN.1
definition:
IssuerAndSerialNumber ::= SEQUENCE { issuer Name, serialNumber CertificateSerialNumber } CertificateSerialNumber ::= INTEGER |
X500Name
class for the
ASN.1 definition of Name
.
Returns
byte
array that contains the
DER encoding of the issuer name and serial number.
Throws
PKCS7Exception
- If the certificate is not
set with an issuer name or serial number.public void setDigestAlgorithm(String algName) throws PKCS7Exception
Parameters
algName | A |
Throws
PKCS7Exception
- If
algName is an invalid digest algorithm name.public void setDigestAlgorithm(byte[] digestOID, int offset, int len) throws PKCS7Exception
Parameters
digestOID | The message-digest algorithm (and any associated parameters) under which the content and authenticated attributes (if present) are digested. | ||
offset | The offset into digestOID. | ||
len | The length of the data in digestOID. |
Throws
PKCS7Exception
- If the digest algorithm OID
is null
.public byte[] getDigestAlgorithmOID()
Returns
public String getDigestAlgorithmName() throws PKCS7Exception
Returns
SHA1
.
Throws
PKCS7Exception
- If
the algorithm name cannot be obtained.public void setAuthenticatedAttrs(X501Attributes attrs) throws PKCS7Exception
Parameters
attrs | An |
Throws
PKCS7Exception
- If the attributes are
invalid or null
.public X501Attributes getAuthenticatedAttrs() throws PKCS7Exception
Returns
X501Attributes
object that contains
signed attributes; that is, attributes are authenticated
by the signer.
It returns null
if there is no authenticated
attributes.
Throws
PKCS7Exception
- If there is a cloning error.public void setEncryptionAlgorithm(String algName) throws PKCS7Exception
RSA
.Parameters
algName | The digest-encryption algorithm identifier. |
Throws
PKCS7Exception
- If
algName is an invalid
name or null
.public void setEncryptionAlgorithm(byte[] encryptOID, int offset, int len) throws PKCS7Exception
Parameters
encryptOID | The digest-encryption algorithm (and any associated parameters) under which the message digest and associated information are encrypted with the signer's private key. | ||
offset | The offset into the encryptOID array. | ||
len | The length of the data in the encryptOID array. |
Throws
PKCS7Exception
- If the
specified OID is null
.public byte[] getEncryptionAlgorithmOID()
Returns
public String getEncryptionAlgorithmName() throws PKCS7Exception
Returns
Throws
PKCS7Exception
- If the
digest-encryption algorithm name
cannot be obtained.public byte[] getEncryptedDigest()
Returns
public void setUnauthenticatedAttrs(X501Attributes attrs) throws PKCS7Exception
Parameters
attrs | An |
Throws
PKCS7Exception
- If there is an error in setting
the unauthenticated attributes or the values are null
.public X501Attributes getUnauthenticatedAttrs() throws PKCS7Exception
Returns
X501Attributes
object that contains
unsigned attributes, that is, the attributes are
unauthenticated by the signer.
It returns null
if there is no unauthenticated
attributes.
Throws
PKCS7Exception
- If there is an error
getting a copy of the unauthenticated attributes.public boolean equals(Object obj)
true
if this object and
obj contain the same
SignerInfo
;
returns false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the
|
Returns
boolean
indicating whether
these objects are equal.public Object clone() throws CloneNotSupportedException
clone
method
to get a deeper clone.
Returns
SignerInfo
object,
a copy of this object.
Throws
CloneNotSupportedException
- If the cloning
operation is not successful.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |