codec.pkcs12
Class SafeBag
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.ArrayList
|
+--codec.asn1.ASN1AbstractCollection
|
+--codec.asn1.ASN1Sequence
|
+--codec.pkcs12.SafeBag
- All Implemented Interfaces:
- ASN1Collection, ASN1Type, Cloneable, Collection, Externalizable, List, Serializable
- public class SafeBag
- extends ASN1Sequence
- implements Serializable
This class represents a SafeBag as defined in PKCS#12.
The ASN.1 definition of this structure is
SafeBag ::= SEQUENCE {
bagId BAG-TYPE.&id ({PKCS12BagSet}),
bagValue [0] EXPLICIT BAG-TYPE.&Type ({PKCS12BagSet}{@bagId})
bagAttributes SET OF PKCS12Attribute OPTIONAL
}
PKCS12Attribute::=SEQUENCE {
attrId Attribute.&id ({PKCS12AttrSet}),
attrValues SET OF ATTRIBUTE.&Type ({PKCS12AttrSet}{@attrId}) -- this type is compatible with the x.500 type 'Attribute'
PKCS12AttrSet ATTRIBUTE::={
friendlyName| -- from PKCS#9
localKeyId, -- from PKCS#9
... -- Other Attributes allowed
This class is sonly used for resolving pkcs12 PDUs. To construct a
PFXpdu please construct a SafeContents from one of the bag types directly.
Supported bagtypes arekeyBag,
pkcs8ShroudedKeyBag, certBag,
crlBag, secretBag,
safeContents.
- Version:
- "$Id: SafeBag.java,v 1.3 2003/01/28 04:46:06 jpeters Exp $"
- Author:
- Michele Boivin
- See Also:
- Serialized Form
|
Constructor Summary |
SafeBag()
Default constructor. |
| 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 interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
reg_
protected PKCS12OIDRegistry reg_
- The OID Registry for resolving
SafeBag
public SafeBag()
- Default constructor.
decode
public void decode(Decoder decoder)
throws ASN1Exception,
IOException
- Decodes this instance. This method extracts the actual content type from
the
ASN1OpenType.
- Overrides:
decode in class ASN1AbstractCollection
- Parameters:
decoder - The Decoder to use.
getAttributes
public ASN1Type[] getAttributes()
getBagType
public ASN1ObjectIdentifier getBagType()
- Returns the OID defining the type of this SafeBag
- Returns:
- the OID defining the type of this SafeBag.
getBagValue
public ASN1Type getBagValue()
- Returns the actual bag in the SafeBag.
- Returns:
- the actual bag in the SafeBag.
setAttributes
public void setAttributes(Attribute[] attr)
- Sets this SafeBag's attributes
- Parameters:
attr - an array of attributes to be set
setBagContents
public void setBagContents(ASN1ObjectIdentifier oid,
ASN1Type bag)
- Sets the SafeBag's contents.
- Parameters:
oid - the OID describing the content typebag - the content itself
setBagContents
public void setBagContents(ASN1RegisteredType bag)
- Sets the SafeBag's contents as a RegisteredType
- Parameters:
bag - the content as a RegisteredType
Copyright © Fraunhofer Gesellschaft. All Rights Reserved.