org.bouncycastle.jce.provider.test
Class CertTest

java.lang.Object
  extended by org.bouncycastle.util.test.SimpleTest
      extended by org.bouncycastle.jce.provider.test.CertTest
All Implemented Interfaces:
Test

public class CertTest
extends SimpleTest


Field Summary
(package private)  byte[] cert1
           
(package private)  byte[] cert2
           
(package private)  byte[] cert3
           
(package private)  byte[] cert4
           
(package private)  byte[] cert5
           
(package private)  byte[] cert6
           
(package private)  byte[] cert7
           
(package private)  byte[] crl1
           
(package private)  byte[] directCRL
           
private  java.security.PublicKey dudPublicKey
           
(package private)  byte[] gost34102001A
           
(package private)  byte[] gost34102001base
           
(package private)  byte[] gost341094A
           
(package private)  byte[] gost341094B
           
(package private)  byte[] gost341094base
           
(package private)  byte[] gostCA1
           
(package private)  byte[] gostCA2
           
(package private)  byte[] inDirectCrl
           
(package private)  byte[] keyUsage
           
(package private)  byte[] nameCert
           
(package private)  byte[] oldEcdsa
           
private  byte[] pkcs7CrlProblem
           
(package private)  byte[] probSelfSignedCert
           
(package private)  byte[] uncompressedPtEC
           
 
Constructor Summary
CertTest()
           
 
Method Summary
 void checkCertificate(int id, byte[] bytes)
           
 void checkCreation1()
          we generate a self signed certificate for the sake of testing - RSA
 void checkCreation2()
          we generate a self signed certificate for the sake of testing - DSA
 void checkCreation3()
          we generate a self signed certificate for the sake of testing - ECDSA
 void checkCreation4()
          we generate a self signed certificate for the sake of testing - GOST3410
 void checkCreation5()
           
private  void checkCRL(int id, byte[] bytes)
           
 void checkCRLCreation1()
           
 void checkCRLCreation2()
           
 void checkCRLCreation3()
           
 void checkKeyUsage(int id, byte[] bytes)
           
 void checkNameCertificate(int id, byte[] bytes)
           
 void checkSelfSignedCertificate(int id, byte[] bytes)
           
private  void createECCert(java.lang.String algorithm, DERObjectIdentifier algOid)
          we generate a self signed certificate for the sake of testing - SHA224withECDSA
private  void createPSSCert(java.lang.String algorithm)
           
 java.lang.String getName()
           
static void main(java.lang.String[] args)
           
private  void pemTest()
           
 void performTest()
           
private  void pkcs7Test()
           
private  void testForgedSignature()
           
 
Methods inherited from class org.bouncycastle.util.test.SimpleTest
areEqual, fail, fail, fail, perform, runTest, runTest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cert1

byte[] cert1

cert2

byte[] cert2

cert3

byte[] cert3

cert4

byte[] cert4

cert5

byte[] cert5

cert6

byte[] cert6

cert7

byte[] cert7

crl1

byte[] crl1

oldEcdsa

byte[] oldEcdsa

uncompressedPtEC

byte[] uncompressedPtEC

keyUsage

byte[] keyUsage

nameCert

byte[] nameCert

probSelfSignedCert

byte[] probSelfSignedCert

gost34102001base

byte[] gost34102001base

gost341094base

byte[] gost341094base

gost341094A

byte[] gost341094A

gost341094B

byte[] gost341094B

gost34102001A

byte[] gost34102001A

gostCA1

byte[] gostCA1

gostCA2

byte[] gostCA2

inDirectCrl

byte[] inDirectCrl

directCRL

byte[] directCRL

pkcs7CrlProblem

private final byte[] pkcs7CrlProblem

dudPublicKey

private java.security.PublicKey dudPublicKey
Constructor Detail

CertTest

public CertTest()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface Test
Specified by:
getName in class SimpleTest

checkCertificate

public void checkCertificate(int id,
                             byte[] bytes)

checkNameCertificate

public void checkNameCertificate(int id,
                                 byte[] bytes)

checkKeyUsage

public void checkKeyUsage(int id,
                          byte[] bytes)

checkSelfSignedCertificate

public void checkSelfSignedCertificate(int id,
                                       byte[] bytes)

checkCreation1

public void checkCreation1()
                    throws java.lang.Exception
we generate a self signed certificate for the sake of testing - RSA

Throws:
java.lang.Exception

checkCreation2

public void checkCreation2()
we generate a self signed certificate for the sake of testing - DSA


checkCreation3

public void checkCreation3()
we generate a self signed certificate for the sake of testing - ECDSA


createECCert

private void createECCert(java.lang.String algorithm,
                          DERObjectIdentifier algOid)
                   throws java.lang.Exception
we generate a self signed certificate for the sake of testing - SHA224withECDSA

Throws:
java.lang.Exception

checkCRL

private void checkCRL(int id,
                      byte[] bytes)

checkCRLCreation1

public void checkCRLCreation1()
                       throws java.lang.Exception
Throws:
java.lang.Exception

checkCRLCreation2

public void checkCRLCreation2()
                       throws java.lang.Exception
Throws:
java.lang.Exception

checkCRLCreation3

public void checkCRLCreation3()
                       throws java.lang.Exception
Throws:
java.lang.Exception

checkCreation4

public void checkCreation4()
                    throws java.lang.Exception
we generate a self signed certificate for the sake of testing - GOST3410

Throws:
java.lang.Exception

checkCreation5

public void checkCreation5()
                    throws java.lang.Exception
Throws:
java.lang.Exception

testForgedSignature

private void testForgedSignature()
                          throws java.lang.Exception
Throws:
java.lang.Exception

pemTest

private void pemTest()
              throws java.lang.Exception
Throws:
java.lang.Exception

pkcs7Test

private void pkcs7Test()
                throws java.lang.Exception
Throws:
java.lang.Exception

createPSSCert

private void createPSSCert(java.lang.String algorithm)
                    throws java.lang.Exception
Throws:
java.lang.Exception

performTest

public void performTest()
                 throws java.lang.Exception
Specified by:
performTest in class SimpleTest
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)