Class cryptiX.user.X509Certificate
All Packages Class Hierarchy This Package Previous Next Index
Class cryptiX.user.X509Certificate
java.lang.Object
|
+----cryptiX.user.X509Certificate
- public class X509Certificate
- extends Object
This class represents a X509 certificate.
-
X509Certificate()
- default constructor
-
X509Certificate(byte[])
- create a x509Certificate form a PEM or DER array
-
X509Certificate(String)
- create a x509Certificate form a PEM or DER file
-
fingerprint()
- returns the fingerprint of this certificate
-
issuer()
- returns the issuer of this certificate
-
netscapeFormat()
- returns true if this cert is in netscape format
-
notAfterDate()
- returns the not after date of this certificate
-
notBeforeDate()
- returns the not before date of this certificate
-
publicKey()
- returns the public key of this certificate
-
saveFormat()
- returns the file format (ASN1.DER, ASN1.PEM) of the cert
-
saveToFile(String)
- saves the certificate
-
serialNumber()
- returns the serial number of this certificate
-
setIssuer(Name)
- sets the issuer of this certificate
-
setNetscapeFormat(boolean)
- sets this certificate to netscape format
-
setNotAfter(Date)
- sets the not after date of this certificate
-
setNotBefore(Date)
- sets the not before date of this certificate
-
setPublicKey(PublicKey)
- sets the public key of this certificate
-
setSaveFormat(int)
- sets the file format (ASN1.DER, ASN1.PEM) of the cert
-
setSerialNumber(BigInt)
- sets the serial number of this certificate
-
setSignatureAlgorithmID(String)
- sets the signature algorithm of this certificate
-
setSubject(Name)
- sets the subject of this certificate
-
setVersion(int)
- sets the version of this certificate
-
signatureAlgorithmID()
- returns the signature algorithm of this certificate
-
signCertificate(PrivateKey)
- signs the certificate with the private key of the issuer
-
subject()
- returns the subject of this certificate
-
toDERArray()
- returns the DER format of the certificate
-
toPEMArray()
- returns the PEM format of the certificate
-
toSSLeay()
-
-
toString()
- converts the certificate to a text output
-
verify()
- verifies a self signed certificate
-
verify(PublicKey)
- verifies a signed certificate
-
version()
- returns the version of this certificate
X509Certificate
public X509Certificate(String fileName) throws IOException, CodingException
- create a x509Certificate form a PEM or DER file
X509Certificate
public X509Certificate(byte arr[]) throws CodingException
- create a x509Certificate form a PEM or DER array
X509Certificate
public X509Certificate()
- default constructor
signCertificate
public void signCertificate(PrivateKey issuerSK) throws CodingException
- signs the certificate with the private key of the issuer
- Parameters:
- issuerSK - the private key of the issuer
verify
public boolean verify() throws CodingException
- verifies a self signed certificate
- Returns:
- true if signature OK
verify
public boolean verify(PublicKey signerPK) throws CodingException
- verifies a signed certificate
- Parameters:
- signerPK - the public key from the signer
- Returns:
- true if signature OK
toPEMArray
public byte[] toPEMArray()
- returns the PEM format of the certificate
toDERArray
public byte[] toDERArray()
- returns the DER format of the certificate
saveToFile
public void saveToFile(String fileName) throws IOException
- saves the certificate
- Parameters:
- fileName - the file name to use
toString
public String toString()
- converts the certificate to a text output
- Overrides:
- toString in class Object
setSaveFormat
public void setSaveFormat(int format)
- sets the file format (ASN1.DER, ASN1.PEM) of the cert
setNetscapeFormat
public void setNetscapeFormat(boolean nf)
- sets this certificate to netscape format
setVersion
public void setVersion(int v)
- sets the version of this certificate
setSerialNumber
public void setSerialNumber(BigInt sn)
- sets the serial number of this certificate
setSignatureAlgorithmID
public void setSignatureAlgorithmID(String said)
- sets the signature algorithm of this certificate
setIssuer
public void setIssuer(Name is)
- sets the issuer of this certificate
setNotBefore
public void setNotBefore(Date nb)
- sets the not before date of this certificate
setNotAfter
public void setNotAfter(Date na)
- sets the not after date of this certificate
setSubject
public void setSubject(Name su)
- sets the subject of this certificate
setPublicKey
public void setPublicKey(PublicKey pk)
- sets the public key of this certificate
saveFormat
public int saveFormat()
- returns the file format (ASN1.DER, ASN1.PEM) of the cert
netscapeFormat
public boolean netscapeFormat()
- returns true if this cert is in netscape format
version
public int version()
- returns the version of this certificate
serialNumber
public BigInt serialNumber()
- returns the serial number of this certificate
signatureAlgorithmID
public String signatureAlgorithmID()
- returns the signature algorithm of this certificate
issuer
public Name issuer()
- returns the issuer of this certificate
notBeforeDate
public Date notBeforeDate()
- returns the not before date of this certificate
notAfterDate
public Date notAfterDate()
- returns the not after date of this certificate
subject
public Name subject()
- returns the subject of this certificate
publicKey
public PublicKey publicKey()
- returns the public key of this certificate
fingerprint
public byte[] fingerprint()
- returns the fingerprint of this certificate
toSSLeay
public String toSSLeay()
All Packages Class Hierarchy This Package Previous Next Index