gnu.java.security.pkcs

Class SignerInfo


public class SignerInfo
extends Object

Constructor Summary

SignerInfo(BERReader ber)
Parse a SignerInfo object.
SignerInfo(X500Principal issuer, BigInteger serialNumber, OID digestAlgorithmOID, byte[] authenticatedAttributes, OID digestEncryptionAlgorithmOID, byte[] encryptedDigest, byte[] unauthenticatedAttributes)
Constructs a new instance of SignerInfo given a designated set of fields.

Method Summary

void
encode(OutputStream out)
Writes to the designated output stream the DER encoding of the current contents of this instance.
byte[]
getAuthenticatedAttributes()
OID
getDigestAlgorithmId()
byte[]
getDigestAlgorithmParams()
OID
getDigestEncryptionAlgorithmId()
byte[]
getDigestEncryptionAlgorithmParams()
byte[]
getEncryptedDigest()
X500Principal
getIssuer()
BigInteger
getSerialNumber()
byte[]
getUnauthenticatedAttributes()
BigInteger
getVersion()

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

SignerInfo

public SignerInfo(BERReader ber)
            throws IOException
Parse a SignerInfo object.

A SignerInfo is a structure with the following ASN.1 syntax:

 SignerInfo ::= SEQUENCE {
   version                       Version, -- always 1 for PKCS7 v1.5
   issuerAndSerialNumber         IssuerAndSerialNumber, -- an INTEGER
   digestAlgorithm               DigestAlgorithmIdentifier,
   authenticatedAttributes   [0] IMPLICIT Attributes OPTIONAL,
   digestEncryptionAlgorithm     DigestEncryptionAlgorithmIdentifier,
   encryptedDigest               EncryptedDigest,
   unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL }

 IssuerAndSerialNumber ::= SEQUENCE {
   issuer       Name,
   serialNumber CertificateSerialNumber
 }

 DigestAlgorithmIdentifier ::= AlgorithmIdentifier

 DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier

 EncryptedDigest ::= OCTET STRING
 

SignerInfo

public SignerInfo(X500Principal issuer,
                  BigInteger serialNumber,
                  OID digestAlgorithmOID,
                  byte[] authenticatedAttributes,
                  OID digestEncryptionAlgorithmOID,
                  byte[] encryptedDigest,
                  byte[] unauthenticatedAttributes)
Constructs a new instance of SignerInfo given a designated set of fields.
Parameters:
issuer - the X.500 Principal name of the signer referenced by this instance.
serialNumber - the serial number of the certificate being used. Both this and the previous arguments are gleaned from the signer's certificate.
digestAlgorithmOID - the OID of the digest algorithm. When constructing the DigestAlgorithmIdentifier with this OID, the parameters part will be NULL.
authenticatedAttributes - the encoding of the set of authenticated attributes to use.
digestEncryptionAlgorithmOID - the OID of the digest encryption algorithm. When constructing the DigestEncryptionAlgorithmIdentifier with this OID, the parameters part will be NULL.
encryptedDigest - the encrypted hash generated with this signer's private key.
unauthenticatedAttributes - the encoding of the set of unauthencticated attributes.

Method Details

encode

public void encode(OutputStream out)
            throws IOException
Writes to the designated output stream the DER encoding of the current contents of this instance.
Parameters:
out - the destination output stream.
Throws:
IOException - if an I/O related exception occurs during the process.

getAuthenticatedAttributes

public byte[] getAuthenticatedAttributes()

getDigestAlgorithmId

public OID getDigestAlgorithmId()

getDigestAlgorithmParams

public byte[] getDigestAlgorithmParams()

getDigestEncryptionAlgorithmId

public OID getDigestEncryptionAlgorithmId()

getDigestEncryptionAlgorithmParams

public byte[] getDigestEncryptionAlgorithmParams()

getEncryptedDigest

public byte[] getEncryptedDigest()

getIssuer

public X500Principal getIssuer()

getSerialNumber

public BigInteger getSerialNumber()

getUnauthenticatedAttributes

public byte[] getUnauthenticatedAttributes()

getVersion

public BigInteger getVersion()

SignerInfo.java -- a SignerInfo object, from PKCS #7 Copyright (C) 2004, 2005, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.