public class SignatureValue
extends java.lang.Object
The signature value field of a CMS SignerInfo is specified as ASN.1 OCTET STRING (see RFC 5652):
SignatureValue ::= OCTET STRINGProvides an alternative way to get the signature value from a
SignerInfo
object got from a SignedDataInOutStream
object during parsing:
SignedDataInOutStream signedData = ...; SignerInfo signerInfo = signedData.getSignerInfos()[0]; SignatureValue signatureValue = signerInfo.getSigValue(); byte[] signature = signatureValue.getValue();Usually it is more convenient to get the signature value immediately by calling method
getSignatureValue
:
... byte[] signature = signatureValue.getSignatureValue();The only purpose of class
SignatureValue
is to get the parsed
encoded representation of the signature value OCTET STRING:
... SignatureValue signatureValue = signerInfo.getSigValue(); byte[] encodedSignatureValue = signatureValue.getEncoded();
Constructor and Description |
---|
SignatureValue(byte[] sigValue)
Creates a SignatureValue from the given byte value.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getEncoded()
Returns the DER encoded SignatureValue.
|
byte[] |
getValue()
Gets the signature value.
|
iaik.asn1.ASN1Object |
toASN1Object()
Returns this SignatureValue as ASN1Object.
|
java.lang.String |
toString()
Returns a String representation of the signature value.
|
public SignatureValue(byte[] sigValue)
sigValue
- the signature value as byte arraypublic byte[] getValue()
public iaik.asn1.ASN1Object toASN1Object()
public byte[] getEncoded()
public java.lang.String toString()
toString
in class java.lang.Object