// 
// Decompiled by Procyon v0.6.0
// 

package org.bouncycastle.cms;

import org.bouncycastle.asn1.rosstandart.RosstandartObjectIdentifiers;
import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers;
import org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers;
import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers;
import java.util.HashMap;
import java.util.HashSet;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.DERNull;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import java.util.Map;
import java.util.Set;

public class DefaultCMSSignatureEncryptionAlgorithmFinder implements CMSSignatureEncryptionAlgorithmFinder
{
    protected static final Set RSA_PKCS1d5;
    protected static final Map GOST_ENC;
    
    @Override
    public AlgorithmIdentifier findEncryptionAlgorithm(final AlgorithmIdentifier algorithmIdentifier) {
        if (DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.contains(algorithmIdentifier.getAlgorithm())) {
            return new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, DERNull.INSTANCE);
        }
        if (DefaultCMSSignatureEncryptionAlgorithmFinder.GOST_ENC.containsKey(algorithmIdentifier.getAlgorithm())) {
            return DefaultCMSSignatureEncryptionAlgorithmFinder.GOST_ENC.get(algorithmIdentifier.getAlgorithm());
        }
        return algorithmIdentifier;
    }
    
    static {
        RSA_PKCS1d5 = new HashSet();
        GOST_ENC = new HashMap();
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(PKCSObjectIdentifiers.md2WithRSAEncryption);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(PKCSObjectIdentifiers.md4WithRSAEncryption);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(PKCSObjectIdentifiers.md5WithRSAEncryption);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(PKCSObjectIdentifiers.sha1WithRSAEncryption);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(OIWObjectIdentifiers.md4WithRSAEncryption);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(OIWObjectIdentifiers.md4WithRSA);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(OIWObjectIdentifiers.md5WithRSA);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(OIWObjectIdentifiers.sha1WithRSA);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160);
        DefaultCMSSignatureEncryptionAlgorithmFinder.RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256);
        DefaultCMSSignatureEncryptionAlgorithmFinder.GOST_ENC.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, new AlgorithmIdentifier(CryptoProObjectIdentifiers.gostR3410_2001, DERNull.INSTANCE));
        DefaultCMSSignatureEncryptionAlgorithmFinder.GOST_ENC.put(RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_256, new AlgorithmIdentifier(RosstandartObjectIdentifiers.id_tc26_gost_3410_12_256, DERNull.INSTANCE));
        DefaultCMSSignatureEncryptionAlgorithmFinder.GOST_ENC.put(RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_512, new AlgorithmIdentifier(RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512, DERNull.INSTANCE));
    }
}
