public class PrivateKeyInfo extends ASN1Object
[IMPLICIT TAGS]
OneAsymmetricKey ::= SEQUENCE {
version Version,
privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
privateKey PrivateKey,
attributes [0] Attributes OPTIONAL,
...,
[[2: publicKey [1] PublicKey OPTIONAL ]],
...
}
PrivateKeyInfo ::= OneAsymmetricKey
Version ::= INTEGER { v1(0), v2(1) } (v1, ..., v2)
PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
{ PUBLIC-KEY,
{ PrivateKeyAlgorithms } }
PrivateKey ::= OCTET STRING
-- Content varies based on type of key. The
-- algorithm identifier dictates the format of
-- the key.
PublicKey ::= BIT STRING
-- Content varies based on type of key. The
-- algorithm identifier dictates the format of
-- the key.
Attributes ::= SET OF Attribute { { OneAsymmetricKeyAttributes } }
| Constructor and Description |
|---|
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
ASN1Encodable privateKey) |
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
ASN1Encodable privateKey,
ASN1Set attributes) |
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
ASN1Encodable privateKey,
ASN1Set attributes,
byte[] publicKey) |
| Modifier and Type | Method and Description |
|---|---|
ASN1Set |
getAttributes() |
static PrivateKeyInfo |
getInstance(ASN1TaggedObject obj,
boolean explicit) |
static PrivateKeyInfo |
getInstance(Object obj) |
AlgorithmIdentifier |
getPrivateKeyAlgorithm() |
ASN1BitString |
getPublicKeyData()
for when the public key is raw bits.
|
boolean |
hasPublicKey()
Return true if a public key is present, false otherwise.
|
ASN1Encodable |
parsePrivateKey() |
ASN1Encodable |
parsePublicKey()
for when the public key is an encoded object - if the bitstring
can't be decoded this routine throws an IOException.
|
ASN1Primitive |
toASN1Primitive()
Method providing a primitive representation of this object suitable for encoding.
|
equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Objectpublic PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, ASN1Encodable privateKey) throws IOException
IOExceptionpublic PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, ASN1Encodable privateKey, ASN1Set attributes) throws IOException
IOExceptionpublic PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, ASN1Encodable privateKey, ASN1Set attributes, byte[] publicKey) throws IOException
IOExceptionpublic static PrivateKeyInfo getInstance(ASN1TaggedObject obj, boolean explicit)
public static PrivateKeyInfo getInstance(Object obj)
public ASN1Set getAttributes()
public AlgorithmIdentifier getPrivateKeyAlgorithm()
public ASN1Encodable parsePrivateKey() throws IOException
IOExceptionpublic boolean hasPublicKey()
public ASN1Encodable parsePublicKey() throws IOException
IOException - - if the bit string doesn't represent a DER
encoded object.public ASN1BitString getPublicKeyData()
public ASN1Primitive toASN1Primitive()
ASN1ObjecttoASN1Primitive in interface ASN1EncodabletoASN1Primitive in class ASN1ObjectCopyright © 2015–2021 The veraPDF Consortium. All rights reserved.