iaik.cms
Class SignatureValue

java.lang.Object
  extended by iaik.cms.SignatureValue

public class SignatureValue
extends java.lang.Object

The SignatureValue of a CMS SignerInfo.

The signature value field of a CMS SignerInfo is specified as ASN.1 OCTET STRING (see RFC 5652):

 
 SignatureValue ::= OCTET STRING
 
Provides 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 Summary
SignatureValue(byte[] sigValue)
          Creates a SignatureValue from the given byte value.
 
Method Summary
 byte[] getEncoded()
          Returns the DER encoded SignatureValue.
 byte[] getValue()
          Gets the signature value.
 ASN1Object toASN1Object()
          Returns this SignatureValue as ASN1Object.
 java.lang.String toString()
          Returns a String representation of the signature value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SignatureValue

public SignatureValue(byte[] sigValue)
Creates a SignatureValue from the given byte value.

Parameters:
sigValue - the signature value as byte array
Method Detail

getValue

public byte[] getValue()
Gets the signature value.

Returns:
the signature value

toASN1Object

public ASN1Object toASN1Object()
Returns this SignatureValue as ASN1Object.

Returns:
this SignatureValue as ASN1Object

getEncoded

public byte[] getEncoded()
Returns the DER encoded SignatureValue.

Returns:
the DER encoded SignatureValue

toString

public java.lang.String toString()
Returns a String representation of the signature value.

Overrides:
toString in class java.lang.Object
Returns:
the String representation

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK-CMS 5.1, (c) 2002 IAIK, (c) 2003 - 2010 SIC