public class KeyBag extends SafeBag
SafeBag
,
Attributes
Modifier | Constructor and Description |
---|---|
protected |
KeyBag()
The default constructor.
|
|
KeyBag(java.security.PrivateKey privateKey)
Creates a new KeyBag from a private key.
|
|
KeyBag(java.security.PrivateKey privateKey,
java.lang.String friendlyName,
byte[] localKeyID)
Creates a new KeyBag from a private key, a friendlyName and a locakKeyID.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(ASN1Object obj)
Decodes the KeyBag given as ASN1Object.
|
java.security.PrivateKey |
getPrivateKey()
Returns the private key of this KeyBag.
|
ASN1Object |
toASN1Object()
Returns this KeyBag as ASN1Object.
|
java.lang.String |
toString()
Returns a String representation of this KeyBag.
|
create, encodeSafeContents, encodeSafeContentsAsASN1Object, getBagType, parseSafeContents, parseSafeContents, register
getAttributes, getFriendlyName, getLocalKeyID, setAttributes, setFriendlyName, setLocalKeyID
protected KeyBag()
public KeyBag(java.security.PrivateKey privateKey)
privateKey
- the private keypublic KeyBag(java.security.PrivateKey privateKey, java.lang.String friendlyName, byte[] localKeyID)
privateKey
- the private keyfriendlyName
- the friendly namelocalKeyID
- the local key idpublic void decode(ASN1Object obj) throws CodingException
obj
- the KeyBag as ASN1ObjectCodingException
- if the KeyBag cannot be decodedpublic ASN1Object toASN1Object() throws CodingException
CodingException
- if an de/encoding error occurspublic java.security.PrivateKey getPrivateKey()