FileDocCategorySizeDatePackage
EncryptedPrivateKeyInfo.javaAPI DocAndroid 1.5 API2225Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.pkcs

EncryptedPrivateKeyInfo

public class EncryptedPrivateKeyInfo extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.x509.AlgorithmIdentifier
algId
private org.bouncycastle.asn1.ASN1OctetString
data
Constructors Summary
public EncryptedPrivateKeyInfo(org.bouncycastle.asn1.ASN1Sequence seq)

        Enumeration e = seq.getObjects();

        algId = AlgorithmIdentifier.getInstance(e.nextElement());
        data = (ASN1OctetString)e.nextElement();
    
public EncryptedPrivateKeyInfo(org.bouncycastle.asn1.x509.AlgorithmIdentifier algId, byte[] encoding)

        this.algId = algId;
        this.data = new DEROctetString(encoding);
    
Methods Summary
public byte[]getEncryptedData()

        return data.getOctets();
    
public org.bouncycastle.asn1.x509.AlgorithmIdentifiergetEncryptionAlgorithm()

        return algId;
    
public static org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfogetInstance(java.lang.Object obj)

        if (obj instanceof EncryptedData)
        {
            return (EncryptedPrivateKeyInfo)obj;
        }
        else if (obj instanceof ASN1Sequence)
        { 
            return new EncryptedPrivateKeyInfo((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("unknown object in factory");
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
EncryptedPrivateKeyInfo ::= SEQUENCE {
encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
encryptedData EncryptedData
}

EncryptedData ::= OCTET STRING

KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= {
... -- For local profiles
}

        ASN1EncodableVector v = new ASN1EncodableVector();

        v.add(algId);
        v.add(data);

        return new DERSequence(v);