iaik.pkcs.pkcs12
Class KeyBag
java.lang.Object
|
+--iaik.pkcs.pkcs12.Attributes
|
+--iaik.pkcs.pkcs12.SafeBag
|
+--iaik.pkcs.pkcs12.KeyBag
- Direct Known Subclasses:
- PKCS8ShroudedKeyBag
- public class KeyBag
- extends SafeBag
This class contains a private key and any associated attributes.
- See Also:
SafeBag,
Attributes
|
Constructor Summary |
protected |
KeyBag()
The default constructor. |
|
KeyBag(PrivateKey privateKey)
Creates a new KeyBag from a private key. |
|
KeyBag(PrivateKey privateKey,
java.lang.String friendlyName,
byte[] localKeyID)
Creates a new KeyBag from a private key, a friendlyName and a locakKeyID. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
KeyBag
protected KeyBag()
- The default constructor.
KeyBag
public KeyBag(PrivateKey privateKey)
- Creates a new KeyBag from a private key.
KeyBag
public KeyBag(PrivateKey privateKey,
java.lang.String friendlyName,
byte[] localKeyID)
- Creates a new KeyBag from a private key, a friendlyName and a locakKeyID.
decode
public void decode(ASN1Object obj)
throws CodingException
- Decodes the KeyBag given as ASN1Object.
- Parameters:
obj - the KeyBag as ASN1Object- Throws:
- CodingException - if the KeyBag cannot be decoded
toASN1Object
public ASN1Object toASN1Object()
throws CodingException
- Returns this KeyBag as ASN1Object.
- Returns:
- this KeyBag as ASN1Object
getPrivateKey
public PrivateKey getPrivateKey()
- Returns the private key of this KeyBag.
toString
public java.lang.String toString()
- Returns a String representation of this KeyBag.
- Overrides:
- toString in class SafeBag