Search in sources :

Example 1 with BcDigestProvider

use of com.github.zhenwei.pkix.operator.bc.BcDigestProvider in project LinLong-Java by zhenwei1108.

the class EnvelopedDataHelper method createTable.

private static Map createTable() {
    Map table = new HashMap();
    table.put(PKCSObjectIdentifiers.id_hmacWithSHA1, new BcDigestProvider() {

        public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) {
            return new SHA1Digest();
        }
    });
    table.put(PKCSObjectIdentifiers.id_hmacWithSHA224, new BcDigestProvider() {

        public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) {
            return new SHA224Digest();
        }
    });
    table.put(PKCSObjectIdentifiers.id_hmacWithSHA256, new BcDigestProvider() {

        public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) {
            return new SHA256Digest();
        }
    });
    table.put(PKCSObjectIdentifiers.id_hmacWithSHA384, new BcDigestProvider() {

        public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) {
            return new SHA384Digest();
        }
    });
    table.put(PKCSObjectIdentifiers.id_hmacWithSHA512, new BcDigestProvider() {

        public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) {
            return new SHA512Digest();
        }
    });
    return Collections.unmodifiableMap(table);
}
Also used : ExtendedDigest(com.github.zhenwei.core.crypto.ExtendedDigest) SHA512Digest(com.github.zhenwei.core.crypto.digests.SHA512Digest) SHA224Digest(com.github.zhenwei.core.crypto.digests.SHA224Digest) HashMap(java.util.HashMap) SHA256Digest(com.github.zhenwei.core.crypto.digests.SHA256Digest) SHA1Digest(com.github.zhenwei.core.crypto.digests.SHA1Digest) BcDigestProvider(com.github.zhenwei.pkix.operator.bc.BcDigestProvider) HashMap(java.util.HashMap) Map(java.util.Map) SHA384Digest(com.github.zhenwei.core.crypto.digests.SHA384Digest) AlgorithmIdentifier(com.github.zhenwei.core.asn1.x509.AlgorithmIdentifier)

Aggregations

AlgorithmIdentifier (com.github.zhenwei.core.asn1.x509.AlgorithmIdentifier)1 ExtendedDigest (com.github.zhenwei.core.crypto.ExtendedDigest)1 SHA1Digest (com.github.zhenwei.core.crypto.digests.SHA1Digest)1 SHA224Digest (com.github.zhenwei.core.crypto.digests.SHA224Digest)1 SHA256Digest (com.github.zhenwei.core.crypto.digests.SHA256Digest)1 SHA384Digest (com.github.zhenwei.core.crypto.digests.SHA384Digest)1 SHA512Digest (com.github.zhenwei.core.crypto.digests.SHA512Digest)1 BcDigestProvider (com.github.zhenwei.pkix.operator.bc.BcDigestProvider)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1