Package com.wolfssl
Class WolfSSLCertificate
- java.lang.Object
-
- com.wolfssl.WolfSSLCertificate
-
public class WolfSSLCertificate extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description WolfSSLCertificate(byte[] der)
WolfSSLCertificate(byte[] in, int format)
WolfSSLCertificate(long x509)
WolfSSLCertificate(java.lang.String fileName)
WolfSSLCertificate(java.lang.String fileName, int format)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
void
free()
Frees an X509.byte[]
getDer()
byte[]
getExtension(java.lang.String oid)
int
getExtensionSet(java.lang.String oid)
java.lang.String
getIssuer()
boolean[]
getKeyUsage()
int
getPathLen()
byte[]
getPubkey()
java.lang.String
getPubkeyType()
java.math.BigInteger
getSerial()
byte[]
getSignature()
java.lang.String
getSignatureOID()
java.lang.String
getSignatureType()
java.lang.String
getSubject()
java.util.Collection<java.util.List<?>>
getSubjectAltNames()
Returns an immutable Collection of subject alternative names from this certificate's SubjectAltName extension.byte[]
getTbs()
int
getVersion()
java.security.cert.X509Certificate
getX509Certificate()
Returns X509Certificate object based on this certificate.int
isCA()
java.util.Date
notAfter()
java.util.Date
notBefore()
java.lang.String
toString()
boolean
verify(byte[] pubKey, int pubKeySz)
-
-
-
Constructor Detail
-
WolfSSLCertificate
public WolfSSLCertificate(byte[] der) throws WolfSSLException
- Throws:
WolfSSLException
-
WolfSSLCertificate
public WolfSSLCertificate(byte[] in, int format) throws WolfSSLException
- Throws:
WolfSSLException
-
WolfSSLCertificate
public WolfSSLCertificate(java.lang.String fileName) throws WolfSSLException
- Throws:
WolfSSLException
-
WolfSSLCertificate
public WolfSSLCertificate(java.lang.String fileName, int format) throws WolfSSLException
- Throws:
WolfSSLException
-
WolfSSLCertificate
public WolfSSLCertificate(long x509) throws WolfSSLException
- Throws:
WolfSSLException
-
-
Method Detail
-
getDer
public byte[] getDer()
-
getTbs
public byte[] getTbs()
-
getSerial
public java.math.BigInteger getSerial()
-
notBefore
public java.util.Date notBefore()
-
notAfter
public java.util.Date notAfter()
-
getVersion
public int getVersion()
-
getSignature
public byte[] getSignature()
-
getSignatureType
public java.lang.String getSignatureType()
-
getSignatureOID
public java.lang.String getSignatureOID()
-
getPubkey
public byte[] getPubkey()
-
getPubkeyType
public java.lang.String getPubkeyType()
-
isCA
public int isCA()
-
getPathLen
public int getPathLen()
-
getSubject
public java.lang.String getSubject()
-
getIssuer
public java.lang.String getIssuer()
-
verify
public boolean verify(byte[] pubKey, int pubKeySz)
-
getKeyUsage
public boolean[] getKeyUsage()
-
getExtension
public byte[] getExtension(java.lang.String oid)
-
getExtensionSet
public int getExtensionSet(java.lang.String oid)
-
getSubjectAltNames
public java.util.Collection<java.util.List<?>> getSubjectAltNames()
Returns an immutable Collection of subject alternative names from this certificate's SubjectAltName extension. Each collection item is a List containing two objects: [0] = Integer representing type of name, 0-8 (ex: 2 == dNSName) [1] = String representing altname entry. Note: this currently returns all altNames as dNSName types, with the second list element being a String.- Returns:
- immutable Collection of subject alternative names, or null
-
getX509Certificate
public java.security.cert.X509Certificate getX509Certificate() throws java.security.cert.CertificateException, java.io.IOException
Returns X509Certificate object based on this certificate.- Returns:
- X509Certificate object
- Throws:
java.security.cert.CertificateException
- on errorjava.io.IOException
- on error closing ByteArrayInputStream
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
free
public void free() throws java.lang.IllegalStateException
Frees an X509.- Throws:
java.lang.IllegalStateException
- WolfSSLCertificate has been freed
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
-