Package org.mozilla.jss.pkix.primitive
Class PrivateKeyInfo
java.lang.Object
org.mozilla.jss.pkix.primitive.PrivateKeyInfo
- All Implemented Interfaces:
Serializable
,Key
,PrivateKey
,Destroyable
,ASN1Value
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A template class for decoding PrivateKeyInfos from BER. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SET
private OCTET_STRING
private AlgorithmIdentifier
private SEQUENCE
private static final long
private static final Tag
private static final PrivateKeyInfo.Template
private INTEGER
-
Constructor Summary
ConstructorsConstructorDescriptionPrivateKeyInfo
(INTEGER version, AlgorithmIdentifier privateKeyAlgorithm, OCTET_STRING privateKey, SET attributes) Create a PrivateKeyInfo from its components. -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(OutputStream ostream) Write this value's DER encoding to an output stream using its own base tag.void
encode
(Tag implicitTag, OutputStream ostream) Write this value's DER encoding to an output stream using an implicit tag.May return null if no attributes are present.byte[]
getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static PrivateKeyInfo.Template
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
version
-
privateKeyAlgorithm
-
privateKey
-
attributes
-
sequence
-
TAG
-
templateInstance
-
-
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
-
getVersion
-
getPrivateKeyAlgorithm
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceKey
-
getFormat
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncoded
in interfaceKey
-
getPrivateKey
-
getAttributes
May return null if no attributes are present. -
getTag
Description copied from interface:ASN1Value
Returns the base tag for this type, not counting any tags that may be imposed on it by its context. -
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using its own base tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using an implicit tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
implicitTag
- Implicit tag.ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
getTemplate
-