org.mozilla.jss.pkix.primitive

Class PrivateKeyInfo

Implemented Interfaces:
ASN1Value, java.security.PrivateKey

public class PrivateKeyInfo
extends java.lang.Object
implements ASN1Value, java.security.PrivateKey

Nested Class Summary

static class
PrivateKeyInfo.Template
A template class for decoding PrivateKeyInfos from BER.

Constructor Summary

PrivateKeyInfo(INTEGER version, AlgorithmIdentifier privateKeyAlgorithm, OCTET_STRING privateKey, SET attributes)
Create a PrivateKeyInfo from its components.

Method Summary

void
encode(OutputStream ostream)
void
encode(Tag implicitTag, OutputStream ostream)
String
getAlgorithm()
SET
getAttributes()
May return null if no attributes are present.
byte[]
getEncoded()
String
getFormat()
OCTET_STRING
getPrivateKey()
AlgorithmIdentifier
getPrivateKeyAlgorithm()
Tag
getTag()
static PrivateKeyInfo.Template
getTemplate()
INTEGER
getVersion()

Constructor Details

PrivateKeyInfo

public PrivateKeyInfo(INTEGER version,
                      AlgorithmIdentifier privateKeyAlgorithm,
                      OCTET_STRING privateKey,
                      SET attributes)
Create a PrivateKeyInfo from its components.
Parameters:
attributes - May be null if there are no attributes, in which case the attributes field will be omitted from the DER encoding. Each element must be a org.mozilla.jss.pkix.primitive.Attribute.

Method Details

encode

public void encode(OutputStream ostream)
            throws IOException
Specified by:
encode in interface ASN1Value

encode

public void encode(Tag implicitTag,
                   OutputStream ostream)
            throws IOException
Specified by:
encode in interface ASN1Value

getAlgorithm

public String getAlgorithm()

getAttributes

public SET getAttributes()
May return null if no attributes are present.

getEncoded

public byte[] getEncoded()

getFormat

public String getFormat()

getPrivateKey

public OCTET_STRING getPrivateKey()

getPrivateKeyAlgorithm

public AlgorithmIdentifier getPrivateKeyAlgorithm()

getTag

public Tag getTag()
Specified by:
getTag in interface ASN1Value

getTemplate

public static PrivateKeyInfo.Template getTemplate()

getVersion

public INTEGER getVersion()