Package org.bouncycastle.asn1.x509
Class SubjectPublicKeyInfo
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
- All Implemented Interfaces:
ASN1Encodable
public class SubjectPublicKeyInfo extends ASN1Object
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.
-
Constructor Summary
Constructors Constructor Description SubjectPublicKeyInfo(ASN1Sequence seq)SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)SubjectPublicKeyInfo(AlgorithmIdentifier algId, ASN1Encodable publicKey) -
Method Summary
Modifier and Type Method Description AlgorithmIdentifiergetAlgorithm()AlgorithmIdentifiergetAlgorithmId()Deprecated.use getAlgorithm()static SubjectPublicKeyInfogetInstance(Object obj)static SubjectPublicKeyInfogetInstance(ASN1TaggedObject obj, boolean explicit)ASN1PrimitivegetPublicKey()Deprecated.use parsePublicKeyDERBitStringgetPublicKeyData()for when the public key is raw bits.ASN1PrimitiveparsePublicKey()for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.ASN1PrimitivetoASN1Primitive()Produce an object suitable for an ASN1OutputStream.Methods inherited from class org.bouncycastle.asn1.ASN1Object
equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Object
-
Constructor Details
-
SubjectPublicKeyInfo
- Throws:
IOException
-
SubjectPublicKeyInfo
-
SubjectPublicKeyInfo
-
-
Method Details
-
getInstance
-
getInstance
-
getAlgorithm
-
getAlgorithmId
Deprecated.use getAlgorithm()- Returns:
- alg ID.
-
parsePublicKey
for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.- Returns:
- the public key as an ASN.1 primitive.
- Throws:
IOException- - if the bit string doesn't represent a DER encoded object.
-
getPublicKey
Deprecated.use parsePublicKeyfor when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.- Returns:
- the public key as an ASN.1 primitive.
- Throws:
IOException- - if the bit string doesn't represent a DER encoded object.
-
getPublicKeyData
for when the public key is raw bits.- Returns:
- the public key as the raw bit string...
-
toASN1Primitive
Produce an object suitable for an ASN1OutputStream.SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, publicKey BIT STRING }- Specified by:
toASN1Primitivein interfaceASN1Encodable- Specified by:
toASN1Primitivein classASN1Object
-