|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.security.pkcsutil.PKCSDerObject | +--com.ibm.security.pkcs12.SafeBag
Implements the PKCS #12 SafeBag type. A SafeBag consists of one particular piece of personal information (a certificate, a key, etc) and optional attributes. PKCS #12, version 1.0 defines six types of SafeBags: KeyBag, ShroudedKeyBag, CertBag, CRLBag, SecretBag and SafeContentsBag.
SafeBag objects are immutable; they cannot be changed once created.
Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject |
provider |
Constructor Summary | |
SafeBag(Bag bag,
PKCSAttributes attrs)
Create a SafeBag from a given bag type and attributes. |
|
SafeBag(Bag bag,
PKCSAttributes attrs,
String provider)
Create a SafeBag from a given bag type and attributes. |
|
SafeBag(byte[] der)
Create a SafeBag subclass with a DER byte array. |
|
SafeBag(byte[] der,
String provider)
Create a SafeBag subclass with a DER byte array. |
|
SafeBag(String filename,
boolean base64)
Create a SafeBag with the filename of the DER-encoded or BASE64-encoded object. |
|
SafeBag(String filename,
boolean base64,
String provider)
Create a SafeBag with the filename of the DER-encoded or BASE64-encoded object. |
Method Summary | |
SafeBag |
addAttributes(PKCSAttribute[] attrs)
Adds one or more attributes to the object and returns the result in a new SafeBag object. |
Object |
clone()
Creates a clone of this SafeBag object. |
protected void |
decode(com.ibm.security.pkcs12.DerValue encoding)
Initialize a SafeBag object from an input stream. |
void |
encode(OutputStream out)
Encodes this object to a DER OutputStream. |
boolean |
equals(Object other)
Determines if this SafeBag object is equivalent to the input object. |
PKCSAttributes |
getAttributes()
Returns a copy of the PKCSAttributes associated with this object, or null if there are no attributes. |
ObjectIdentifier |
getObjectIdentifier()
Returns a copy of the object identifier of this SafeBag. |
byte[] |
getValue()
Returns the DER-encoding of this SafeBag's content. |
SafeBag |
replaceAttributes(PKCSAttributes attrs)
Replaces the attributes on this object and returns the result in a new SafeBag object. |
String |
toString()
Returns a string representation of this SafeBag object. |
Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject |
decode,
decode,
encode,
hashCode,
read,
readBASE64,
write,
write,
writeBASE64 |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public SafeBag(byte[] der) throws IOException
public SafeBag(byte[] der, String provider) throws IOException
public SafeBag(Bag bag, PKCSAttributes attrs) throws IOException
public SafeBag(Bag bag, PKCSAttributes attrs, String provider) throws IOException
public SafeBag(String filename, boolean base64) throws IOException
filename
- name of the DER-encoded or base64-encoded objectbase64
- true if BASE64-encoded, false if DER-encodedpublic SafeBag(String filename, boolean base64, String provider) throws IOException
filename
- name of the DER-encoded or base64-encoded objectbase64
- true if BASE64-encoded, false if DER-encodedprovider
- a provider to be usedMethod Detail |
public void encode(OutputStream out) throws IOException
out
- the DER OutputStream to write the encoded data to.public SafeBag addAttributes(PKCSAttribute[] attrs)
attrs
- the PKCS attributes to be added.public SafeBag replaceAttributes(PKCSAttributes attrs)
attrs
- the PKCS attributes to associate with this object.public PKCSAttributes getAttributes()
public ObjectIdentifier getObjectIdentifier()
public byte[] getValue()
public boolean equals(Object other)
other
- the object to compare this one to.public Object clone()
public String toString()
protected void decode(com.ibm.security.pkcs12.DerValue encoding) throws IOException
encoding
- an input stream with a DER-encoded SafeBag object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |