|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.pkcs.PrivateKeyInfo
RFC 5958 [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 Summary | |
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
ASN1Encodable privateKey)
Construct a PrivateKeyInfo around an ASN.1 structure/primitive. |
|
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
ASN1Encodable privateKey,
ASN1Set attributes)
Construct a PrivateKeyInfo around an ASN.1 structure/primitive with attributes. |
|
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
ASN1Encodable privateKey,
ASN1Set attributes,
byte[] publicKey)
Construct a PrivateKeyInfo around an ASN.1 structure/primitive with attributes and the public key. |
|
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
byte[] privateKey)
Construct a PrivateKeyInfo around a raw encoding. |
|
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
byte[] privateKey,
ASN1Set attributes)
Construct a PrivateKeyInfo around an ASN.1 structure/primitive with attributes. |
|
PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm,
byte[] privateKey,
ASN1Set attributes,
byte[] publicKey)
Construct a PrivateKeyInfo around a raw encoding with attributes and the public key. |
Method Summary | |
ASN1Set |
getAttributes()
|
static PrivateKeyInfo |
getInstance(ASN1TaggedObject obj,
boolean explicit)
|
static PrivateKeyInfo |
getInstance(java.lang.Object obj)
|
ASN1OctetString |
getPrivateKey()
|
AlgorithmIdentifier |
getPrivateKeyAlgorithm()
|
int |
getPrivateKeyLength()
|
ASN1BitString |
getPublicKeyData()
for when the public key is raw bits. |
ASN1Integer |
getVersion()
|
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. |
Methods inherited from class org.bouncycastle.asn1.ASN1Object |
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, byte[] privateKey) throws java.io.IOException
privateKeyAlgorithm
- algorithm identifier for the private key.privateKey
- byte encoding of the private key, used as a raw encoding.public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, ASN1Encodable privateKey) throws java.io.IOException
privateKeyAlgorithm
- algorithm identifier for the private key.privateKey
- the ASN.1 structure/primitive representing the private key.
java.io.IOException
- if encoding the privateKey object into an OCTET STRING fails.public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, ASN1Encodable privateKey, ASN1Set attributes) throws java.io.IOException
privateKeyAlgorithm
- algorithm identifier for the private key.privateKey
- the ASN.1 structure/primitive representing the private key.attributes
- attributes associated with private key.
java.io.IOException
- if encoding the privateKey object into an OCTET STRING fails.public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, byte[] privateKey, ASN1Set attributes) throws java.io.IOException
privateKeyAlgorithm
- algorithm identifier for the private key.privateKey
- byte encoding of the private key, used as a raw encoding.attributes
- attributes associated with private key.
java.io.IOException
- if encoding the privateKey object into an OCTET STRING fails.public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, ASN1Encodable privateKey, ASN1Set attributes, byte[] publicKey) throws java.io.IOException
privateKeyAlgorithm
- algorithm identifier for the private key.privateKey
- the ASN.1 structure/primitive representing the private key.attributes
- attributes associated with private key.publicKey
- public key encoding.
java.io.IOException
- if encoding the privateKey object into an OCTET STRING fails.public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, byte[] privateKey, ASN1Set attributes, byte[] publicKey)
privateKeyAlgorithm
- algorithm identifier for the private key.privateKey
- byte encoding of the private key, used as a raw encoding.attributes
- attributes associated with private key.publicKey
- public key encoding.Method Detail |
public static PrivateKeyInfo getInstance(ASN1TaggedObject obj, boolean explicit)
public static PrivateKeyInfo getInstance(java.lang.Object obj)
public ASN1Integer getVersion()
public ASN1Set getAttributes()
public AlgorithmIdentifier getPrivateKeyAlgorithm()
public ASN1OctetString getPrivateKey()
public int getPrivateKeyLength()
public ASN1Encodable parsePrivateKey() throws java.io.IOException
java.io.IOException
public boolean hasPublicKey()
public ASN1Encodable parsePublicKey() throws java.io.IOException
java.io.IOException
- - if the bit string doesn't represent a DER
encoded object.public ASN1BitString getPublicKeyData()
public ASN1Primitive toASN1Primitive()
ASN1Object
toASN1Primitive
in interface ASN1Encodable
toASN1Primitive
in class ASN1Object
|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |