FileDocCategorySizeDatePackage
PrivateKeyInfo.javaAPI DocAndroid 1.5 API4618Wed May 06 22:41:06 BST 2009org.apache.harmony.security.pkcs8

PrivateKeyInfo

public class PrivateKeyInfo extends Object
The class implements the ASN.1 DER encoding and decoding of the PKCS#8 PrivateKeyInfo having the following ASN.1 notation: PrivateKeyInfo ::= SEQUENCE { version Version, privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, privateKey PrivateKey, attributes [0] IMPLICIT Attributes OPTIONAL } Version ::= INTEGER PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier PrivateKey ::= OCTET STRING Attributes ::= SET OF Attribute

Fields Summary
private int
version
private org.apache.harmony.security.x509.AlgorithmIdentifier
privateKeyAlgorithm
private byte[]
privateKey
private List
attributes
private byte[]
encoding
public static final org.apache.harmony.security.asn1.ASN1Sequence
ASN1
Constructors Summary
public PrivateKeyInfo(int version, org.apache.harmony.security.x509.AlgorithmIdentifier privateKeyAlgorithm, byte[] privateKey, List attributes)


        this.version = version;
        this.privateKeyAlgorithm = privateKeyAlgorithm;
        this.privateKey = privateKey;
        this.attributes = attributes;
    
private PrivateKeyInfo(int version, org.apache.harmony.security.x509.AlgorithmIdentifier privateKeyAlgorithm, byte[] privateKey, List attributes, byte[] encoding)

        this(version, privateKeyAlgorithm, privateKey, attributes);
        this.encoding = encoding;
    
Methods Summary
public org.apache.harmony.security.x509.AlgorithmIdentifiergetAlgorithmIdentifier()

return
Returns AlgorithmIdentifier.

        return privateKeyAlgorithm;
    
public java.util.ListgetAttributes()

return
Returns List of attributes.

        return attributes;
    
public byte[]getEncoded()
Returns ASN.1 encoded form of this PrivateKeyInfo.

return
a byte array containing ASN.1 encode form.

        if (encoding == null) {
            encoding = ASN1.encode(this);
        }
        return encoding;
    
public byte[]getPrivateKey()

return
Returns the OCTET STRING.

        return privateKey;
    
public intgetVersion()

return
Returns version.

        return version;