Search in sources :

Example 6 with SignatureAlgorithm

use of de.carne.certmgr.certs.security.SignatureAlgorithm in project certmgr by hdecarne.

the class SignatureAlgorithmTest method testGetDefaultSet.

/**
 * Test the algorithm provisioning.
 */
@Test
public void testGetDefaultSet() {
    for (KeyPairAlgorithm keyPairAlgorithm : KeyPairAlgorithm.getDefaultSet(null, true)) {
        Set<SignatureAlgorithm> expertAlgorithms = SignatureAlgorithm.getDefaultSet(keyPairAlgorithm.algorithm(), null, true);
        System.out.println(keyPairAlgorithm.algorithm() + " expert algorithms:");
        for (SignatureAlgorithm expertAlgorithm : expertAlgorithms) {
            System.out.println(keyPairAlgorithm.algorithm() + "/" + expertAlgorithm);
        }
    }
    for (KeyPairAlgorithm keyPairAlgorithm : KeyPairAlgorithm.getDefaultSet(null, false)) {
        Set<SignatureAlgorithm> standardAlgorithms = SignatureAlgorithm.getDefaultSet(keyPairAlgorithm.algorithm(), null, false);
        System.out.println(keyPairAlgorithm.algorithm() + " standard algorithms:");
        for (SignatureAlgorithm standardAlgorithm : standardAlgorithms) {
            System.out.println(keyPairAlgorithm.algorithm() + "/" + standardAlgorithm);
        }
        Assert.assertTrue(standardAlgorithms.size() > 0);
    }
}
Also used : KeyPairAlgorithm(de.carne.certmgr.certs.security.KeyPairAlgorithm) SignatureAlgorithm(de.carne.certmgr.certs.security.SignatureAlgorithm) Test(org.junit.Test)

Aggregations

SignatureAlgorithm (de.carne.certmgr.certs.security.SignatureAlgorithm)6 Date (java.util.Date)3 CertObjectStore (de.carne.certmgr.certs.CertObjectStore)2 UserCertStoreEntry (de.carne.certmgr.certs.UserCertStoreEntry)2 UserCertStorePreferences (de.carne.certmgr.certs.UserCertStorePreferences)2 UpdateCRLRequest (de.carne.certmgr.certs.x509.UpdateCRLRequest)2 KeyPair (java.security.KeyPair)2 Test (org.junit.Test)2 UserCertStore (de.carne.certmgr.certs.UserCertStore)1 UserCertStoreEntryId (de.carne.certmgr.certs.UserCertStoreEntryId)1 KeyPairAlgorithm (de.carne.certmgr.certs.security.KeyPairAlgorithm)1 PKCS10CertificateRequest (de.carne.certmgr.certs.x509.PKCS10CertificateRequest)1 IOException (java.io.IOException)1 BigInteger (java.math.BigInteger)1 X509Certificate (java.security.cert.X509Certificate)1 LocalDate (java.time.LocalDate)1 ArrayList (java.util.ArrayList)1 BackingStoreException (java.util.prefs.BackingStoreException)1 X500Principal (javax.security.auth.x500.X500Principal)1