Package org.gudy.bouncycastle.asn1.x509
Class SubjectPublicKeyInfo
- java.lang.Object
-
- org.gudy.bouncycastle.asn1.ASN1Encodable
-
- org.gudy.bouncycastle.asn1.x509.SubjectPublicKeyInfo
-
- All Implemented Interfaces:
DEREncodable
public class SubjectPublicKeyInfo extends ASN1Encodable
The object that contains the public key stored in a certficate.The getEncoded() method in the public keys in the JCE produces a DER encoded one of these.
-
-
Field Summary
Fields Modifier and Type Field Description private AlgorithmIdentifier
algId
private DERBitString
keyData
-
Fields inherited from class org.gudy.bouncycastle.asn1.ASN1Encodable
BER, DER
-
-
Constructor Summary
Constructors Constructor Description SubjectPublicKeyInfo(ASN1Sequence seq)
SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)
SubjectPublicKeyInfo(AlgorithmIdentifier algId, DEREncodable publicKey)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AlgorithmIdentifier
getAlgorithmId()
static SubjectPublicKeyInfo
getInstance(java.lang.Object obj)
static SubjectPublicKeyInfo
getInstance(ASN1TaggedObject obj, boolean explicit)
DERObject
getPublicKey()
for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.DERBitString
getPublicKeyData()
for when the public key is raw bits...DERObject
toASN1Object()
Produce an object suitable for an ASN1OutputStream.-
Methods inherited from class org.gudy.bouncycastle.asn1.ASN1Encodable
equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode
-
-
-
-
Field Detail
-
algId
private AlgorithmIdentifier algId
-
keyData
private DERBitString keyData
-
-
Constructor Detail
-
SubjectPublicKeyInfo
public SubjectPublicKeyInfo(AlgorithmIdentifier algId, DEREncodable publicKey)
-
SubjectPublicKeyInfo
public SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)
-
SubjectPublicKeyInfo
public SubjectPublicKeyInfo(ASN1Sequence seq)
-
-
Method Detail
-
getInstance
public static SubjectPublicKeyInfo getInstance(ASN1TaggedObject obj, boolean explicit)
-
getInstance
public static SubjectPublicKeyInfo getInstance(java.lang.Object obj)
-
getAlgorithmId
public AlgorithmIdentifier getAlgorithmId()
-
getPublicKey
public DERObject getPublicKey() throws java.io.IOException
for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.- Throws:
java.io.IOException
- - if the bit string doesn't represent a DER encoded object.
-
getPublicKeyData
public DERBitString getPublicKeyData()
for when the public key is raw bits...
-
toASN1Object
public DERObject toASN1Object()
Produce an object suitable for an ASN1OutputStream.SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, publicKey BIT STRING }
- Specified by:
toASN1Object
in classASN1Encodable
-
-