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 voidfinalize()voidfree()Frees an X509.byte[]getDer()byte[]getExtension(java.lang.String oid)intgetExtensionSet(java.lang.String oid)java.lang.StringgetIssuer()boolean[]getKeyUsage()intgetPathLen()byte[]getPubkey()java.lang.StringgetPubkeyType()java.math.BigIntegergetSerial()byte[]getSignature()java.lang.StringgetSignatureOID()java.lang.StringgetSignatureType()java.lang.StringgetSubject()java.util.Collection<java.util.List<?>>getSubjectAltNames()Returns an immutable Collection of subject alternative names from this certificate's SubjectAltName extension.byte[]getTbs()intgetVersion()java.security.cert.X509CertificategetX509Certificate()Returns X509Certificate object based on this certificate.intisCA()java.util.DatenotAfter()java.util.DatenotBefore()java.lang.StringtoString()booleanverify(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.IOExceptionReturns 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:
toStringin classjava.lang.Object
-
free
public void free() throws java.lang.IllegalStateExceptionFrees an X509.- Throws:
java.lang.IllegalStateException- WolfSSLCertificate has been freed
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-