Package org.bouncycastle.cms.test
Class CMSTestUtil
- java.lang.Object
-
- org.bouncycastle.cms.test.CMSTestUtil
-
public class CMSTestUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static javax.crypto.KeyGeneratoraes192kgstatic javax.crypto.KeyGeneratoraesKgstatic javax.crypto.KeyGeneratorcamelliaKgstatic booleanDEBUGstatic javax.crypto.KeyGeneratordesede128kgstatic javax.crypto.KeyGeneratordesede192kgstatic java.security.KeyPairGeneratordhKpgstatic java.security.KeyPairGeneratordsaKpgstatic java.security.KeyPairGeneratorecDsaKpgstatic java.security.KeyPairGeneratorecGostKpgstatic java.security.KeyPairGeneratored25519Kpgstatic java.security.KeyPairGeneratored448Kpgstatic java.security.KeyPairGeneratorgostKpgstatic java.security.KeyPairGeneratorkpgstatic java.security.SecureRandomrandstatic javax.crypto.KeyGeneratorrc2128kgstatic javax.crypto.KeyGeneratorrc240kgstatic javax.crypto.KeyGeneratorrc264kgstatic javax.crypto.KeyGeneratorseedKgstatic java.math.BigIntegerserialNumber
-
Constructor Summary
Constructors Constructor Description CMSTestUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringdumpBase64(byte[] data)static X509AttributeCertificateHoldergetAttributeCertificate()static javax.crypto.SecretKeymakeAES192Key()static javax.crypto.SecretKeymakeAESKey(int keySize)static java.security.cert.X509CertificatemakeCACertificate(java.security.KeyPair _subKP, java.lang.String _subDN, java.security.KeyPair _issKP, java.lang.String _issDN)static javax.crypto.SecretKeymakeCamelliaKey(int keySize)static java.security.cert.X509CertificatemakeCertificate(java.security.KeyPair _subKP, java.lang.String _subDN, java.security.KeyPair _issKP, java.lang.String _issDN)static java.security.cert.X509CertificatemakeCertificate(java.security.KeyPair subKP, java.lang.String _subDN, java.security.KeyPair issKP, java.lang.String _issDN, boolean _ca)static java.security.cert.X509CertificatemakeCertificate(java.security.KeyPair subKP, java.lang.String _subDN, java.security.KeyPair issKP, java.lang.String _issDN, org.bouncycastle.asn1.x509.AlgorithmIdentifier keyAlgID)static java.security.cert.X509CRLmakeCrl(java.security.KeyPair pair)static javax.crypto.SecretKeymakeDesede128Key()static javax.crypto.SecretKeymakeDesede192Key()static java.security.KeyPairmakeDhKeyPair()static java.security.KeyPairmakeDsaKeyPair()static java.security.KeyPairmakeEcDsaKeyPair()static java.security.KeyPairmakeEcGostKeyPair()static java.security.KeyPairmakeEd25519KeyPair()static java.security.KeyPairmakeEd448KeyPair()static java.security.KeyPairmakeGostKeyPair()static java.security.KeyPairmakeKeyPair()static java.security.cert.X509CertificatemakeOaepCertificate(java.security.KeyPair _subKP, java.lang.String _subDN, java.security.KeyPair _issKP, java.lang.String _issDN)static java.security.cert.X509CertificatemakeOaepCertificate(java.security.KeyPair subKP, java.lang.String _subDN, java.security.KeyPair issKP, java.lang.String _issDN, boolean _ca)static javax.crypto.SecretKeymakeRC2128Key()static javax.crypto.SecretKeymakeRC240Key()static javax.crypto.SecretKeymakeRC264Key()static javax.crypto.SecretKeymakeSEEDKey()static java.security.cert.X509CertificatemakeV1Certificate(java.security.KeyPair subKP, java.lang.String _subDN, java.security.KeyPair issKP, java.lang.String _issDN)static byte[]streamToByteArray(java.io.InputStream in)
-
-
-
Field Detail
-
rand
public static java.security.SecureRandom rand
-
kpg
public static java.security.KeyPairGenerator kpg
-
gostKpg
public static java.security.KeyPairGenerator gostKpg
-
dsaKpg
public static java.security.KeyPairGenerator dsaKpg
-
dhKpg
public static java.security.KeyPairGenerator dhKpg
-
ecGostKpg
public static java.security.KeyPairGenerator ecGostKpg
-
ecDsaKpg
public static java.security.KeyPairGenerator ecDsaKpg
-
ed25519Kpg
public static java.security.KeyPairGenerator ed25519Kpg
-
ed448Kpg
public static java.security.KeyPairGenerator ed448Kpg
-
aes192kg
public static javax.crypto.KeyGenerator aes192kg
-
desede128kg
public static javax.crypto.KeyGenerator desede128kg
-
desede192kg
public static javax.crypto.KeyGenerator desede192kg
-
rc240kg
public static javax.crypto.KeyGenerator rc240kg
-
rc264kg
public static javax.crypto.KeyGenerator rc264kg
-
rc2128kg
public static javax.crypto.KeyGenerator rc2128kg
-
aesKg
public static javax.crypto.KeyGenerator aesKg
-
seedKg
public static javax.crypto.KeyGenerator seedKg
-
camelliaKg
public static javax.crypto.KeyGenerator camelliaKg
-
serialNumber
public static java.math.BigInteger serialNumber
-
DEBUG
public static final boolean DEBUG
- See Also:
- Constant Field Values
-
-
Method Detail
-
dumpBase64
public static java.lang.String dumpBase64(byte[] data)
-
getAttributeCertificate
public static X509AttributeCertificateHolder getAttributeCertificate() throws java.lang.Exception
- Throws:
java.lang.Exception
-
makeKeyPair
public static java.security.KeyPair makeKeyPair()
-
makeGostKeyPair
public static java.security.KeyPair makeGostKeyPair()
-
makeDsaKeyPair
public static java.security.KeyPair makeDsaKeyPair()
-
makeEd25519KeyPair
public static java.security.KeyPair makeEd25519KeyPair()
-
makeEd448KeyPair
public static java.security.KeyPair makeEd448KeyPair()
-
makeEcDsaKeyPair
public static java.security.KeyPair makeEcDsaKeyPair()
-
makeDhKeyPair
public static java.security.KeyPair makeDhKeyPair()
-
makeEcGostKeyPair
public static java.security.KeyPair makeEcGostKeyPair()
-
makeDesede128Key
public static javax.crypto.SecretKey makeDesede128Key()
-
makeAES192Key
public static javax.crypto.SecretKey makeAES192Key()
-
makeDesede192Key
public static javax.crypto.SecretKey makeDesede192Key()
-
makeRC240Key
public static javax.crypto.SecretKey makeRC240Key()
-
makeRC264Key
public static javax.crypto.SecretKey makeRC264Key()
-
makeRC2128Key
public static javax.crypto.SecretKey makeRC2128Key()
-
makeSEEDKey
public static javax.crypto.SecretKey makeSEEDKey()
-
makeAESKey
public static javax.crypto.SecretKey makeAESKey(int keySize)
-
makeCamelliaKey
public static javax.crypto.SecretKey makeCamelliaKey(int keySize)
-
makeCertificate
public static java.security.cert.X509Certificate makeCertificate(java.security.KeyPair _subKP, java.lang.String _subDN, java.security.KeyPair _issKP, java.lang.String _issDN) throws java.security.GeneralSecurityException, java.io.IOException, OperatorCreationException- Throws:
java.security.GeneralSecurityExceptionjava.io.IOExceptionOperatorCreationException
-
makeOaepCertificate
public static java.security.cert.X509Certificate makeOaepCertificate(java.security.KeyPair _subKP, java.lang.String _subDN, java.security.KeyPair _issKP, java.lang.String _issDN) throws java.security.GeneralSecurityException, java.io.IOException, OperatorCreationException- Throws:
java.security.GeneralSecurityExceptionjava.io.IOExceptionOperatorCreationException
-
makeCACertificate
public static java.security.cert.X509Certificate makeCACertificate(java.security.KeyPair _subKP, java.lang.String _subDN, java.security.KeyPair _issKP, java.lang.String _issDN) throws java.security.GeneralSecurityException, java.io.IOException, OperatorCreationException- Throws:
java.security.GeneralSecurityExceptionjava.io.IOExceptionOperatorCreationException
-
makeV1Certificate
public static java.security.cert.X509Certificate makeV1Certificate(java.security.KeyPair subKP, java.lang.String _subDN, java.security.KeyPair issKP, java.lang.String _issDN) throws java.security.GeneralSecurityException, java.io.IOException, OperatorCreationException- Throws:
java.security.GeneralSecurityExceptionjava.io.IOExceptionOperatorCreationException
-
makeCertificate
public static java.security.cert.X509Certificate makeCertificate(java.security.KeyPair subKP, java.lang.String _subDN, java.security.KeyPair issKP, java.lang.String _issDN, boolean _ca) throws java.security.GeneralSecurityException, java.io.IOException, OperatorCreationException- Throws:
java.security.GeneralSecurityExceptionjava.io.IOExceptionOperatorCreationException
-
makeCertificate
public static java.security.cert.X509Certificate makeCertificate(java.security.KeyPair subKP, java.lang.String _subDN, java.security.KeyPair issKP, java.lang.String _issDN, org.bouncycastle.asn1.x509.AlgorithmIdentifier keyAlgID) throws java.security.GeneralSecurityException, java.io.IOException, OperatorCreationException- Throws:
java.security.GeneralSecurityExceptionjava.io.IOExceptionOperatorCreationException
-
makeOaepCertificate
public static java.security.cert.X509Certificate makeOaepCertificate(java.security.KeyPair subKP, java.lang.String _subDN, java.security.KeyPair issKP, java.lang.String _issDN, boolean _ca) throws java.security.GeneralSecurityException, java.io.IOException, OperatorCreationException- Throws:
java.security.GeneralSecurityExceptionjava.io.IOExceptionOperatorCreationException
-
makeCrl
public static java.security.cert.X509CRL makeCrl(java.security.KeyPair pair) throws java.lang.Exception- Throws:
java.lang.Exception
-
streamToByteArray
public static byte[] streamToByteArray(java.io.InputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
-