iaik.pkcs.pkcs12
Class PKCS8ShroudedKeyBag

java.lang.Object
  |
  +--iaik.pkcs.pkcs12.Attributes
        |
        +--iaik.pkcs.pkcs12.SafeBag
              |
              +--iaik.pkcs.pkcs12.KeyBag
                    |
                    +--iaik.pkcs.pkcs12.PKCS8ShroudedKeyBag

public class PKCS8ShroudedKeyBag
extends KeyBag

This class contains an encrypted private key and any associated attributes.

See Also:
SafeBag, Attributes

Constructor Summary
protected PKCS8ShroudedKeyBag()
          The default constructor.
protected PKCS8ShroudedKeyBag(KeyBag keyBag)
          Creates a new PKCS8ShroudedKeyBag from a KeyBag.
 
Method Summary
 void decode(ASN1Object obj)
          Decodes the PKCS8ShroudedKeyBag given as ASN1Object.
protected  void decrypt(char[] password)
          Decrypts this KeyBag using the given password.
protected  void encrypt(char[] password, AlgorithmID algorithm, int iterationCount)
          Encrypts this KeyBag using the given password.
 ASN1Object toASN1Object()
          Returns this PKCS8ShroudedKeyBag as ASN1Object.
 java.lang.String toString()
          Returns a String representation of this PKCS8ShroudedKeyBag.
 
Methods inherited from class iaik.pkcs.pkcs12.KeyBag
getPrivateKey
 
Methods inherited from class iaik.pkcs.pkcs12.SafeBag
create, encodeSafeContents, getBagType, parseSafeContents, register
 
Methods inherited from class iaik.pkcs.pkcs12.Attributes
getAttributes, getFriendlyName, getLocalKeyID, setAttributes, setFriendlyName, setLocalKeyID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PKCS8ShroudedKeyBag

protected PKCS8ShroudedKeyBag()
The default constructor.

PKCS8ShroudedKeyBag

protected PKCS8ShroudedKeyBag(KeyBag keyBag)
Creates a new PKCS8ShroudedKeyBag from a KeyBag.
Method Detail

decode

public void decode(ASN1Object obj)
            throws CodingException
Decodes the PKCS8ShroudedKeyBag given as ASN1Object.
Overrides:
decode in class KeyBag
Parameters:
obj - the PKCS8ShroudedKeyBag as ASN1Object
Throws:
CodingException - if the PKCS8ShroudedKeyBag cannot be decoded

toASN1Object

public ASN1Object toASN1Object()
                        throws CodingException
Returns this PKCS8ShroudedKeyBag as ASN1Object.
Overrides:
toASN1Object in class KeyBag
Returns:
this PKCS8ShroudedKeyBag as ASN1Object

decrypt

protected void decrypt(char[] password)
                throws NoSuchAlgorithmException,
                       GeneralSecurityException
Decrypts this KeyBag using the given password.

encrypt

protected void encrypt(char[] password,
                       AlgorithmID algorithm,
                       int iterationCount)
                throws NoSuchAlgorithmException
Encrypts this KeyBag using the given password.

toString

public java.lang.String toString()
Returns a String representation of this PKCS8ShroudedKeyBag.
Overrides:
toString in class KeyBag
Returns:
the String representation