public class PrivateKeyInfo extends java.lang.Object implements ASN1Value, java.security.PrivateKey
Modifier and Type | Class and Description |
---|---|
static class |
PrivateKeyInfo.Template
A template class for decoding PrivateKeyInfos from BER.
|
Constructor and Description |
---|
PrivateKeyInfo(INTEGER version,
AlgorithmIdentifier privateKeyAlgorithm,
OCTET_STRING privateKey,
SET attributes)
Create a PrivateKeyInfo from its components.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(java.io.OutputStream ostream)
Write this value's DER encoding to an output stream using
its own base tag.
|
void |
encode(Tag implicitTag,
java.io.OutputStream ostream)
Write this value's DER encoding to an output stream using
an implicit tag.
|
java.lang.String |
getAlgorithm() |
SET |
getAttributes()
May return null if no attributes are present.
|
byte[] |
getEncoded() |
java.lang.String |
getFormat() |
OCTET_STRING |
getPrivateKey() |
AlgorithmIdentifier |
getPrivateKeyAlgorithm() |
Tag |
getTag()
Returns the base tag for this type, not counting any tags
that may be imposed on it by its context.
|
static PrivateKeyInfo.Template |
getTemplate() |
INTEGER |
getVersion() |
public PrivateKeyInfo(INTEGER version, AlgorithmIdentifier privateKeyAlgorithm, OCTET_STRING privateKey, SET attributes)
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.public INTEGER getVersion()
public AlgorithmIdentifier getPrivateKeyAlgorithm()
public java.lang.String getAlgorithm()
getAlgorithm
in interface java.security.Key
public java.lang.String getFormat()
getFormat
in interface java.security.Key
public byte[] getEncoded()
getEncoded
in interface java.security.Key
public OCTET_STRING getPrivateKey()
public SET getAttributes()
public Tag getTag()
ASN1Value
public void encode(java.io.OutputStream ostream) throws java.io.IOException
ASN1Value
public void encode(Tag implicitTag, java.io.OutputStream ostream) throws java.io.IOException
ASN1Value
public static PrivateKeyInfo.Template getTemplate()