|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--demo.pkcs.PKCS7
This class verifies a PKCS#7 certifcate chain extractet from a PKCS7CertList.
A PKCS7CertList represents the degenerate case of a PKCS#7
SignedData
object where there are no signers on the content.
PKCS7CertLists can be used for dealing with certificate chains as
disseminated by Netscape Navigator or Internet Explorer.
The PKCS7CertList
is read in from a file which may have
been created by using the writeTo
method of the
iaik.pkcs.PKCS7CertList
class.
When starting the TestPKCS7
test, you have to specify
the file name holding the PKCS7CertList
to be parsed:
TestPKCS7 <file name>
PKCS7CertList
Constructor Summary | |
PKCS7()
|
Method Summary | |
static void |
main(String[] arg)
Reads a PKCS#7 certificate chain from a file and verifies the certificates stored inside. |
static boolean |
verifyCertificate(X509Certificate userCert,
X509Certificate caCert)
Verifies the digital signature of a certificate. |
static void |
verifyCertificateChain(X509Certificate[] certs)
Verifies a chain of certificates where the user certificate is stored at index 0. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PKCS7()
Method Detail |
public static boolean verifyCertificate(X509Certificate userCert, X509Certificate caCert)
userCert
- the certificate to verifycaCert
- the certificate of the CA which has issued the userCert
or null
if the userCert is a self signed certificatetrue
, if the signature is OK, false
otherwisepublic static void verifyCertificateChain(X509Certificate[] certs)
certs[0] = user certificate. certs[x] = self signed CA certificate
certs
- the certificate chain to verifypublic static void main(String[] arg)
Usage:
TestPKCS7 <file name>
first_argument
- the name of the file holding the certificate chain
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |