codec.pkcs12
Class CertBag

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
                    |
                    +--codec.asn1.ASN1AbstractCollection
                          |
                          +--codec.asn1.ASN1Sequence
                                |
                                +--codec.pkcs12.CertBag
All Implemented Interfaces:
ASN1Collection, ASN1RegisteredType, ASN1Type, Cloneable, Collection, Externalizable, List, Serializable

public class CertBag
extends ASN1Sequence
implements ASN1RegisteredType, Serializable

This class represents a certBag as defined in PKCS#12. The ASN.1 definition of this structure is

 certBag ::= SEQUENCE {
   certId       BAG-TYPE.&id ({CertTypes}),
   certValue    [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId})
 }
 
 x509Certificate BAG-TYPE::=
        {OCTET STRING IDENTIFIED BY {certTypes 1}} -- DER encoded X.509 certificate stored in OCTET STRING
        
 sdsiCertificate BAG-TYPE::=
        {IA5String IDENTIFIED BY {certTypes 2}}    -- Base64 encoded SDSI certificate stored in IA5String
        
 CertTypes BAG-TYPE::={
        x509Certificate|
        sdsiCertificate|
        ...                                        -- For future extensions
 

Version:
"$Id: CertBag.java,v 1.4 2005/03/22 14:01:56 flautens Exp $"
Author:
Michele Boivin
See Also:
Serialized Form

Field Summary
protected  PKCS12OIDRegistry reg_
          DOCUMENT ME!
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CertBag()
          The default constructor.
CertBag(X509Certificate cert)
          Constructor for a x.509 certBag.
 
Method Summary
 void decode(Decoder decoder)
          Decodes this instance.
 ASN1ObjectIdentifier getCertId()
           
 X509Certificate getCertificate()
           
 ASN1Type getCertValue()
           
 ASN1ObjectIdentifier getOID()
          This method returns the official OID that identifies this ASN.1 type.
 
Methods inherited from class codec.asn1.ASN1Sequence
getTag
 
Methods inherited from class codec.asn1.ASN1AbstractCollection
checkConstraints, encode, getCollection, getConstraint, getTagClass, getValue, isExplicit, isOptional, isType, readExternal, setConstraint, setExplicit, setOptional, toString, writeExternal
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface codec.asn1.ASN1Type
checkConstraints, encode, getConstraint, getTag, getTagClass, getValue, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Field Detail

reg_

protected PKCS12OIDRegistry reg_
DOCUMENT ME!
Constructor Detail

CertBag

public CertBag()
The default constructor.

CertBag

public CertBag(X509Certificate cert)
        throws CertificateEncodingException
Constructor for a x.509 certBag. The octet string holds the DER encoded x.509 certificate.
Parameters:
cert - the certicifate
Method Detail

decode

public void decode(Decoder decoder)
            throws ASN1Exception,
                   IOException
Decodes this instance. This method extracts the actual content type from the ASN1OpenType.
Specified by:
decode in interface ASN1Type
Overrides:
decode in class ASN1AbstractCollection
Parameters:
decoder - The Decoder to use.

getCertId

public ASN1ObjectIdentifier getCertId()
Returns:
The OID describing the certValue of this structure.

getCertificate

public X509Certificate getCertificate()
                               throws CertificateException
Returns:
The value of the certficate bag. In case of a x509 certificate the ASN1OctetString holding the DER encoded x509certificate.

getCertValue

public ASN1Type getCertValue()
Returns:
The value of the certficate bag. In case of a x509 certificate the ASN1OctetString holding the DER encoded x509certificate.

getOID

public ASN1ObjectIdentifier getOID()
Description copied from interface: ASN1RegisteredType
This method returns the official OID that identifies this ASN.1 type.
Specified by:
getOID in interface ASN1RegisteredType
Returns:
the OID for this bag type.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.