Package org.bouncycastle.asn1.x509
Class SubjectPublicKeyInfo
- java.lang.Object
-
- org.bouncycastle.asn1.ASN1Object
-
- org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
-
- All Implemented Interfaces:
ASN1Encodable,Encodable
public class SubjectPublicKeyInfo extends ASN1Object
The object that contains the public key stored in a certificate.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)Deprecated.use SubjectPublicKeyInfo.getInstance()SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)SubjectPublicKeyInfo(AlgorithmIdentifier algId, ASN1Encodable publicKey)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AlgorithmIdentifiergetAlgorithm()AlgorithmIdentifiergetAlgorithmId()Deprecated.use getAlgorithm()static SubjectPublicKeyInfogetInstance(java.lang.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
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
-
-
-
Constructor Detail
-
SubjectPublicKeyInfo
public SubjectPublicKeyInfo(AlgorithmIdentifier algId, ASN1Encodable publicKey) throws java.io.IOException
- Throws:
java.io.IOException
-
SubjectPublicKeyInfo
public SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)
-
SubjectPublicKeyInfo
public SubjectPublicKeyInfo(ASN1Sequence seq)
Deprecated.use SubjectPublicKeyInfo.getInstance()
-
-
Method Detail
-
getInstance
public static SubjectPublicKeyInfo getInstance(ASN1TaggedObject obj, boolean explicit)
-
getInstance
public static SubjectPublicKeyInfo getInstance(java.lang.Object obj)
-
getAlgorithm
public AlgorithmIdentifier getAlgorithm()
-
getAlgorithmId
public AlgorithmIdentifier getAlgorithmId()
Deprecated.use getAlgorithm()- Returns:
- alg ID.
-
parsePublicKey
public ASN1Primitive parsePublicKey() 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.- Returns:
- the public key as an ASN.1 primitive.
- Throws:
java.io.IOException- - if the bit string doesn't represent a DER encoded object.
-
getPublicKey
public ASN1Primitive getPublicKey() throws java.io.IOException
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:
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.- Returns:
- the public key as the raw bit string...
-
toASN1Primitive
public ASN1Primitive toASN1Primitive()
Produce an object suitable for an ASN1OutputStream.SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, publicKey BIT STRING }- Specified by:
toASN1Primitivein interfaceASN1Encodable- Specified by:
toASN1Primitivein classASN1Object- Returns:
- a primitive representation of this object.
-
-