Info Call to Crypto API

Description

List of all calls to cryptographic methods.

Recommendation

Do not use insecure or weak cryptographic algorithms. For example, the Data Encryption Standard (DES) encryption algorithm is considered highly insecure

Do not use Object.equals() to compare cryptographic keys

Cryptographic keys should never be serialized

Technical details

Method org.spongycastle.openssl.PEMUtilities.crypt() calling method javax.crypto.spec.IvParameterSpec.<init>()


    static byte[] crypt(boolean p17, java.security.Provider p18, byte[] p19, char[] p20, String p21, byte[] p22)
    {
        javax.crypto.spec.RC2ParameterSpec v10_2 = new javax.crypto.spec.IvParameterSpec(p22);
        String v3 = "CBC";
        String v9 = "PKCS5Padding";
        if (p21.endsWith("-CFB")) {
            v3 = "CFB";
            v9 = "NoPadding";
        }
        if ((p21.endsWith("-ECB")) || (("DES-EDE".equals(p21)) || ("DES-EDE3".equals(p21)))) {
            v3 = "ECB";
            v10_2 = 0;
        }
        if (p21.endsWith("-OFB")) {
            v3 = "OFB";
            v9 = "NoPadding";
        }
        javax.crypto.SecretKey v11;
        String v2;
        if (!p21.startsWith("DES-EDE")) {
            if (!p21.startsWith("DES-")) {
                if (!p21.startsWith("BF-")) {
                    if (!p21.startsWith("RC2-")) {
                        if (!p21.startsWith("AES-")) {
                            throw new org.spongycastle.openssl.EncryptionException("unknown encryption with private key");
                        } else {
                            v2 = "AES";
                            byte[] v12 = p22;
                            if (p22.length > 8) {
                                v12 = new byte[8];
                                System.arraycopy(p22, 0, v12, 0, 8);
                            }
                            int v7_1;
                            if (!p21.startsWith("AES-128-")) {
                                if (!p21.startsWith("AES-192-")) {
                                    if (!p21.startsWith("AES-256-")) {
                                        throw new org.spongycastle.openssl.EncryptionException("unknown AES encryption with private key");
                                    } else {
                                        v7_1 = 256;
                                    }
                                } else {
                                    v7_1 = 192;
                                }
                            } else {
                                v7_1 = 128;
                            }
                            v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "AES", (v7_1 / 8), v12);
                        }
                    } else {
                        v2 = "RC2";
                        int v7_0 = 128;
                        if (!p21.startsWith("RC2-40-")) {
                            if (p21.startsWith("RC2-64-")) {
                                v7_0 = 64;
                            }
                        } else {
                            v7_0 = 40;
                        }
                        v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "RC2", (v7_0 / 8), p22);
                        if (v10_2 != null) {
                            v10_2 = new javax.crypto.spec.RC2ParameterSpec(v7_0, p22);
                        } else {
                            v10_2 = new javax.crypto.spec.RC2ParameterSpec(v7_0);
                        }
                    }
                } else {
                    v2 = "Blowfish";
                    v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "Blowfish", 16, p22);
                }
            } else {
                v2 = "DES";
                v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "DES", 8, p22);
            }
        } else {
            int v5;
            v2 = "DESede";
            if (p21.startsWith("DES-EDE3")) {
                v5 = 0;
            } else {
                v5 = 1;
            }
            v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "DESede", 24, p22, v5);
        }
        try {
            int v8;
            javax.crypto.Cipher v4 = javax.crypto.Cipher.getInstance(new StringBuilder().append(v2).append("/").append(v3).append("/").append(v9).toString(), p18);
        } catch (Exception v6) {
            throw new org.spongycastle.openssl.EncryptionException("exception using cipher - please check password and data.", v6);
        }
        if (!p17) {
            v8 = 2;
        } else {
            v8 = 1;
        }
        if (v10_2 != null) {
            v4.init(v8, v11, v10_2);
        } else {
            v4.init(v8, v11);
        }
        return v4.doFinal(p19);
    }

Method org.spongycastle.jce.provider.symmetric.SEED$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("SEED", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.symmetric.RC6$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("RC6", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.symmetric.RC5$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("RC5", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.symmetric.Noekeon$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("Noekeon", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.symmetric.IDEA$AlgParams.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p3)
    {
        if (p3 != javax.crypto.spec.IvParameterSpec) {
            throw new java.security.spec.InvalidParameterSpecException("unknown parameter spec passed to IV parameters object.");
        } else {
            return new javax.crypto.spec.IvParameterSpec(this.iv);
        }
    }

Method org.spongycastle.jce.provider.symmetric.IDEA$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("IDEA", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.symmetric.Camellia$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("Camellia", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.symmetric.CAST5$AlgParams.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p3)
    {
        if (p3 != javax.crypto.spec.IvParameterSpec) {
            throw new java.security.spec.InvalidParameterSpecException("unknown parameter spec passed to CAST5 parameters object.");
        } else {
            return new javax.crypto.spec.IvParameterSpec(this.iv);
        }
    }

Method org.spongycastle.jce.provider.symmetric.CAST5$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("CAST5", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.symmetric.AES$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("AES", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.JDKAlgorithmParameters$RC2AlgorithmParameters.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p4)
    {
        if ((p4 != javax.crypto.spec.RC2ParameterSpec) || (this.parameterVersion == -1)) {
            if (p4 != javax.crypto.spec.IvParameterSpec) {
                throw new java.security.spec.InvalidParameterSpecException("unknown parameter spec passed to RC2 parameters object.");
            } else {
                javax.crypto.spec.RC2ParameterSpec v0_2 = new javax.crypto.spec.IvParameterSpec(this.iv);
            }
        } else {
            if (this.parameterVersion >= 256) {
                v0_2 = new javax.crypto.spec.RC2ParameterSpec(this.parameterVersion, this.iv);
            } else {
                v0_2 = new javax.crypto.spec.RC2ParameterSpec(org.spongycastle.jce.provider.JDKAlgorithmParameters$RC2AlgorithmParameters.ekb[this.parameterVersion], this.iv);
            }
        }
        return v0_2;
    }

Method org.spongycastle.jce.provider.JDKAlgorithmParameters$IVAlgorithmParameters.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p3)
    {
        if (p3 != javax.crypto.spec.IvParameterSpec) {
            throw new java.security.spec.InvalidParameterSpecException("unknown parameter spec passed to IV parameters object.");
        } else {
            return new javax.crypto.spec.IvParameterSpec(this.iv);
        }
    }

Method org.spongycastle.jce.provider.JDKAlgorithmParameterGenerator$RC2.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        java.security.AlgorithmParameters v2;
        if (this.spec != null) {
            try {
                v2 = java.security.AlgorithmParameters.getInstance("RC2", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
                v2.init(this.spec);
            } catch (Exception v0_1) {
                throw new RuntimeException(v0_1.getMessage());
            }
        } else {
            byte[] v1 = new byte[8];
            if (this.random == null) {
                this.random = new java.security.SecureRandom();
            }
            this.random.nextBytes(v1);
            try {
                v2 = java.security.AlgorithmParameters.getInstance("RC2", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
                v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            } catch (Exception v0_0) {
                throw new RuntimeException(v0_0.getMessage());
            }
        }
        return v2;
    }

Method org.spongycastle.jce.provider.JDKAlgorithmParameterGenerator$DES.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = java.security.AlgorithmParameters.getInstance("DES", org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jce.provider.JDKKeyStore.encodeKey() calling method java.security.Key.getAlgorithm()


    private void encodeKey(java.security.Key p3, java.io.DataOutputStream p4)
    {
        byte[] v0 = p3.getEncoded();
        if (!(p3 instanceof java.security.PrivateKey)) {
            if (!(p3 instanceof java.security.PublicKey)) {
                p4.write(2);
            } else {
                p4.write(1);
            }
        } else {
            p4.write(0);
        }
        p4.writeUTF(p3.getFormat());
        p4.writeUTF(p3.getAlgorithm());
        p4.writeInt(v0.length);
        p4.write(v0);
        return;
    }

Method org.spongycastle.jce.provider.JCEStreamCipher.engineInit() calling method java.security.Key.getAlgorithm()


    protected void engineInit(int p10, java.security.Key p11, java.security.spec.AlgorithmParameterSpec p12, java.security.SecureRandom p13)
    {
        this.pbeSpec = 0;
        this.pbeAlgorithm = 0;
        this.engineParams = 0;
        if ((p11 instanceof javax.crypto.SecretKey)) {
            org.spongycastle.crypto.params.ParametersWithIV v3_1;
            if (!(p11 instanceof org.spongycastle.jce.provider.JCEPBEKey)) {
                if (p12 != null) {
                    if (!(p12 instanceof javax.crypto.spec.IvParameterSpec)) {
                        throw new IllegalArgumentException("unknown parameter type.");
                    } else {
                        v3_1 = new org.spongycastle.crypto.params.ParametersWithIV(new org.spongycastle.crypto.params.KeyParameter(p11.getEncoded()), ((javax.crypto.spec.IvParameterSpec) p12).getIV());
                        this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v3_1);
                    }
                } else {
                    v3_1 = new org.spongycastle.crypto.params.KeyParameter(p11.getEncoded());
                }
            } else {
                if (((org.spongycastle.jce.provider.JCEPBEKey) p11).getOID() == null) {
                    this.pbeAlgorithm = ((org.spongycastle.jce.provider.JCEPBEKey) p11).getAlgorithm();
                } else {
                    this.pbeAlgorithm = ((org.spongycastle.jce.provider.JCEPBEKey) p11).getOID().getId();
                }
                if (((org.spongycastle.jce.provider.JCEPBEKey) p11).getParam() == null) {
                    if (!(p12 instanceof javax.crypto.spec.PBEParameterSpec)) {
                        throw new java.security.InvalidAlgorithmParameterException("PBE requires PBE parameters to be set.");
                    } else {
                        v3_1 = org.spongycastle.jce.provider.PBE$Util.makePBEParameters(((org.spongycastle.jce.provider.JCEPBEKey) p11), p12, this.cipher.getAlgorithmName());
                        this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p12);
                    }
                } else {
                    v3_1 = ((org.spongycastle.jce.provider.JCEPBEKey) p11).getParam();
                    this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jce.provider.JCEPBEKey) p11).getSalt(), ((org.spongycastle.jce.provider.JCEPBEKey) p11).getIterationCount());
                }
                if (((org.spongycastle.jce.provider.JCEPBEKey) p11).getIvSize() != 0) {
                    this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v3_1);
                }
            }
            if ((this.ivLength != 0) && (!(v3_1 instanceof org.spongycastle.crypto.params.ParametersWithIV))) {
                java.security.SecureRandom v1_0 = p13;
                if (p13 == null) {
                    v1_0 = new java.security.SecureRandom();
                }
                if ((p10 != 1) && (p10 != 3)) {
                    throw new java.security.InvalidAlgorithmParameterException("no IV set when one expected");
                } else {
                    byte[] v0 = new byte[this.ivLength];
                    v1_0.nextBytes(v0);
                    org.spongycastle.crypto.params.ParametersWithIV v4_1 = new org.spongycastle.crypto.params.ParametersWithIV(v3_1, v0);
                    this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v4_1);
                    v3_1 = v4_1;
                }
            }
            switch (p10) {
                case 1:
                case 3:
                    this.cipher.init(1, v3_1);
                    break;
                case 2:
                case 4:
                    this.cipher.init(0, v3_1);
                    break;
                default:
                    System.out.println("eeek!");
            }
            return;
        } else {
            throw new java.security.InvalidKeyException(new StringBuilder().append("Key for algorithm ").append(p11.getAlgorithm()).append(" not suitable for symmetric enryption.").toString());
        }
    }

Method org.spongycastle.jce.provider.JCEBlockCipher.engineInit() calling method java.security.Key.getAlgorithm()


    protected void engineInit(int p15, java.security.Key p16, java.security.spec.AlgorithmParameterSpec p17, java.security.SecureRandom p18)
    {
        this.pbeSpec = 0;
        this.pbeAlgorithm = 0;
        this.engineParams = 0;
        if ((p16 instanceof javax.crypto.SecretKey)) {
            if ((p17 != null) || (!this.baseEngine.getAlgorithmName().startsWith("RC5-64"))) {
                org.spongycastle.crypto.params.ParametersWithIV v7_1;
                if (!(p16 instanceof org.spongycastle.jce.provider.JCEPBEKey)) {
                    if (p17 != null) {
                        if (!(p17 instanceof javax.crypto.spec.IvParameterSpec)) {
                            org.spongycastle.crypto.params.ParametersWithIV v8_1;
                            if (!(p17 instanceof org.spongycastle.jce.spec.GOST28147ParameterSpec)) {
                                if (!(p17 instanceof javax.crypto.spec.RC2ParameterSpec)) {
                                    if (!(p17 instanceof javax.crypto.spec.RC5ParameterSpec)) {
                                        throw new java.security.InvalidAlgorithmParameterException("unknown parameter type.");
                                    } else {
                                        v7_1 = new org.spongycastle.crypto.params.RC5Parameters(p16.getEncoded(), ((javax.crypto.spec.RC5ParameterSpec) p17).getRounds());
                                        if (!this.baseEngine.getAlgorithmName().startsWith("RC5")) {
                                            throw new java.security.InvalidAlgorithmParameterException("RC5 parameters passed to a cipher that is not RC5.");
                                        } else {
                                            if (!this.baseEngine.getAlgorithmName().equals("RC5-32")) {
                                                if ((this.baseEngine.getAlgorithmName().equals("RC5-64")) && (((javax.crypto.spec.RC5ParameterSpec) p17).getWordSize() != 64)) {
                                                    throw new java.security.InvalidAlgorithmParameterException(new StringBuilder().append("RC5 already set up for a word size of 64 not ").append(((javax.crypto.spec.RC5ParameterSpec) p17).getWordSize()).append(".").toString());
                                                }
                                            } else {
                                                if (((javax.crypto.spec.RC5ParameterSpec) p17).getWordSize() != 32) {
                                                    throw new java.security.InvalidAlgorithmParameterException(new StringBuilder().append("RC5 already set up for a word size of 32 not ").append(((javax.crypto.spec.RC5ParameterSpec) p17).getWordSize()).append(".").toString());
                                                }
                                            }
                                            if ((((javax.crypto.spec.RC5ParameterSpec) p17).getIV() == null) || (this.ivLength == 0)) {
                                                if ((this.ivLength == 0) || ((v7_1 instanceof org.spongycastle.crypto.params.ParametersWithIV))) {
                                                    org.spongycastle.crypto.params.ParametersWithIV v8_4 = v7_1;
                                                } else {
                                                    java.security.SecureRandom v4_0 = p18;
                                                    if (p18 == null) {
                                                        v4_0 = new java.security.SecureRandom();
                                                    }
                                                    if ((p15 != 1) && (p15 != 3)) {
                                                        if (this.cipher.getUnderlyingCipher().getAlgorithmName().indexOf("PGPCFB") >= 0) {
                                                        } else {
                                                            throw new java.security.InvalidAlgorithmParameterException("no IV set when one expected");
                                                        }
                                                    } else {
                                                        byte[] v3 = new byte[this.ivLength];
                                                        v4_0.nextBytes(v3);
                                                        v8_4 = new org.spongycastle.crypto.params.ParametersWithIV(v7_1, v3);
                                                        this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v8_4);
                                                    }
                                                }
                                                if ((p18 == null) || (!this.padded)) {
                                                    org.spongycastle.crypto.params.ParametersWithIV v7_6 = v8_4;
                                                } else {
                                                    v7_6 = new org.spongycastle.crypto.params.ParametersWithRandom(v8_4, p18);
                                                }
                                                try {
                                                    switch (p15) {
                                                        case 1:
                                                        case 3:
                                                            this.cipher.init(1, v7_6);
                                                            return;
                                                        case 2:
                                                        case 4:
                                                            this.cipher.init(0, v7_6);
                                                            return;
                                                        default:
                                                            throw new java.security.InvalidParameterException(new StringBuilder().append("unknown opmode ").append(p15).append(" passed").toString());
                                                    }
                                                } catch (Exception v1) {
                                                }
                                                throw new java.security.InvalidKeyException(v1.getMessage());
                                            } else {
                                                v8_1 = new org.spongycastle.crypto.params.ParametersWithIV(v7_1, ((javax.crypto.spec.RC5ParameterSpec) p17).getIV());
                                                this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v8_1);
                                            }
                                        }
                                    }
                                } else {
                                    v7_1 = new org.spongycastle.crypto.params.RC2Parameters(p16.getEncoded(), ((javax.crypto.spec.RC2ParameterSpec) p17).getEffectiveKeyBits());
                                    if ((((javax.crypto.spec.RC2ParameterSpec) p17).getIV() == null) || (this.ivLength == 0)) {
                                    } else {
                                        v8_1 = new org.spongycastle.crypto.params.ParametersWithIV(v7_1, ((javax.crypto.spec.RC2ParameterSpec) p17).getIV());
                                        this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v8_1);
                                    }
                                }
                            } else {
                                v7_1 = new org.spongycastle.crypto.params.ParametersWithSBox(new org.spongycastle.crypto.params.KeyParameter(p16.getEncoded()), ((org.spongycastle.jce.spec.GOST28147ParameterSpec) p17).getSbox());
                                if ((((org.spongycastle.jce.spec.GOST28147ParameterSpec) p17).getIV() == null) || (this.ivLength == 0)) {
                                } else {
                                    v8_1 = new org.spongycastle.crypto.params.ParametersWithIV(v7_1, ((org.spongycastle.jce.spec.GOST28147ParameterSpec) p17).getIV());
                                    this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v8_1);
                                }
                            }
                            v7_1 = v8_1;
                        } else {
                            if (this.ivLength == 0) {
                                if ((this.modeName == null) || (!this.modeName.equals("ECB"))) {
                                    v7_1 = new org.spongycastle.crypto.params.KeyParameter(p16.getEncoded());
                                } else {
                                    throw new java.security.InvalidAlgorithmParameterException("ECB mode does not use an IV");
                                }
                            } else {
                                if ((((javax.crypto.spec.IvParameterSpec) p17).getIV().length == this.ivLength) || (this.isAEADModeName(this.modeName))) {
                                    v7_1 = new org.spongycastle.crypto.params.ParametersWithIV(new org.spongycastle.crypto.params.KeyParameter(p16.getEncoded()), ((javax.crypto.spec.IvParameterSpec) p17).getIV());
                                    this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v7_1);
                                } else {
                                    throw new java.security.InvalidAlgorithmParameterException(new StringBuilder().append("IV must be ").append(this.ivLength).append(" bytes long.").toString());
                                }
                            }
                        }
                    } else {
                        v7_1 = new org.spongycastle.crypto.params.KeyParameter(p16.getEncoded());
                    }
                } else {
                    if (((org.spongycastle.jce.provider.JCEPBEKey) p16).getOID() == null) {
                        this.pbeAlgorithm = ((org.spongycastle.jce.provider.JCEPBEKey) p16).getAlgorithm();
                    } else {
                        this.pbeAlgorithm = ((org.spongycastle.jce.provider.JCEPBEKey) p16).getOID().getId();
                    }
                    if (((org.spongycastle.jce.provider.JCEPBEKey) p16).getParam() == null) {
                        if (!(p17 instanceof javax.crypto.spec.PBEParameterSpec)) {
                            throw new java.security.InvalidAlgorithmParameterException("PBE requires PBE parameters to be set.");
                        } else {
                            this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p17);
                            v7_1 = org.spongycastle.jce.provider.PBE$Util.makePBEParameters(((org.spongycastle.jce.provider.JCEPBEKey) p16), p17, this.cipher.getUnderlyingCipher().getAlgorithmName());
                        }
                    } else {
                        v7_1 = ((org.spongycastle.jce.provider.JCEPBEKey) p16).getParam();
                        this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jce.provider.JCEPBEKey) p16).getSalt(), ((org.spongycastle.jce.provider.JCEPBEKey) p16).getIterationCount());
                    }
                    if ((v7_1 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                        this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v7_1);
                    }
                }
            } else {
                throw new java.security.InvalidAlgorithmParameterException("RC5 requires an RC5ParametersSpec to be passed in.");
            }
        } else {
            throw new java.security.InvalidKeyException(new StringBuilder().append("Key for algorithm ").append(p16.getAlgorithm()).append(" not suitable for symmetric enryption.").toString());
        }
    }

Method org.spongycastle.openssl.PKCS8Generator.init() calling method javax.crypto.Cipher.getInstance()


    private void init(java.security.PrivateKey p6, String p7, java.security.Provider p8)
    {
        this.key = p6;
        this.algorithm = p7;
        this.iterationCount = 2048;
        try {
            this.cipher = javax.crypto.Cipher.getInstance(p7, p8);
        } catch (javax.crypto.NoSuchPaddingException v1) {
            throw new java.security.NoSuchAlgorithmException(new StringBuilder().append(p7).append(" found, but padding not available: ").append(v1.getMessage()).toString());
        }
        if (!org.spongycastle.openssl.PEMUtilities.isPKCS5Scheme2(new org.spongycastle.asn1.DERObjectIdentifier(p7))) {
            this.secKeyFact = javax.crypto.SecretKeyFactory.getInstance(p7, p8);
        } else {
            this.paramGen = java.security.AlgorithmParameterGenerator.getInstance(p7, p8);
        }
        return;
    }

Method org.spongycastle.openssl.PEMUtilities.crypt() calling method javax.crypto.Cipher.getInstance()


    static byte[] crypt(boolean p17, java.security.Provider p18, byte[] p19, char[] p20, String p21, byte[] p22)
    {
        javax.crypto.spec.RC2ParameterSpec v10_2 = new javax.crypto.spec.IvParameterSpec(p22);
        String v3 = "CBC";
        String v9 = "PKCS5Padding";
        if (p21.endsWith("-CFB")) {
            v3 = "CFB";
            v9 = "NoPadding";
        }
        if ((p21.endsWith("-ECB")) || (("DES-EDE".equals(p21)) || ("DES-EDE3".equals(p21)))) {
            v3 = "ECB";
            v10_2 = 0;
        }
        if (p21.endsWith("-OFB")) {
            v3 = "OFB";
            v9 = "NoPadding";
        }
        javax.crypto.SecretKey v11;
        String v2;
        if (!p21.startsWith("DES-EDE")) {
            if (!p21.startsWith("DES-")) {
                if (!p21.startsWith("BF-")) {
                    if (!p21.startsWith("RC2-")) {
                        if (!p21.startsWith("AES-")) {
                            throw new org.spongycastle.openssl.EncryptionException("unknown encryption with private key");
                        } else {
                            v2 = "AES";
                            byte[] v12 = p22;
                            if (p22.length > 8) {
                                v12 = new byte[8];
                                System.arraycopy(p22, 0, v12, 0, 8);
                            }
                            int v7_1;
                            if (!p21.startsWith("AES-128-")) {
                                if (!p21.startsWith("AES-192-")) {
                                    if (!p21.startsWith("AES-256-")) {
                                        throw new org.spongycastle.openssl.EncryptionException("unknown AES encryption with private key");
                                    } else {
                                        v7_1 = 256;
                                    }
                                } else {
                                    v7_1 = 192;
                                }
                            } else {
                                v7_1 = 128;
                            }
                            v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "AES", (v7_1 / 8), v12);
                        }
                    } else {
                        v2 = "RC2";
                        int v7_0 = 128;
                        if (!p21.startsWith("RC2-40-")) {
                            if (p21.startsWith("RC2-64-")) {
                                v7_0 = 64;
                            }
                        } else {
                            v7_0 = 40;
                        }
                        v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "RC2", (v7_0 / 8), p22);
                        if (v10_2 != null) {
                            v10_2 = new javax.crypto.spec.RC2ParameterSpec(v7_0, p22);
                        } else {
                            v10_2 = new javax.crypto.spec.RC2ParameterSpec(v7_0);
                        }
                    }
                } else {
                    v2 = "Blowfish";
                    v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "Blowfish", 16, p22);
                }
            } else {
                v2 = "DES";
                v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "DES", 8, p22);
            }
        } else {
            int v5;
            v2 = "DESede";
            if (p21.startsWith("DES-EDE3")) {
                v5 = 0;
            } else {
                v5 = 1;
            }
            v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "DESede", 24, p22, v5);
        }
        try {
            int v8;
            javax.crypto.Cipher v4 = javax.crypto.Cipher.getInstance(new StringBuilder().append(v2).append("/").append(v3).append("/").append(v9).toString(), p18);
        } catch (Exception v6) {
            throw new org.spongycastle.openssl.EncryptionException("exception using cipher - please check password and data.", v6);
        }
        if (!p17) {
            v8 = 2;
        } else {
            v8 = 1;
        }
        if (v10_2 != null) {
            v4.init(v8, v11, v10_2);
        } else {
            v4.init(v8, v11);
        }
        return v4.doFinal(p19);
    }

Method org.spongycastle.openssl.PEMReader$EncryptedPrivateKeyParser.parseObject() calling method javax.crypto.Cipher.getInstance()


    public Object parseObject(org.spongycastle.util.io.pem.PemObject p24)
    {
        try {
            org.spongycastle.asn1.pkcs.EncryptedPrivateKeyInfo v9 = org.spongycastle.asn1.pkcs.EncryptedPrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Object.fromByteArray(p24.getContent()));
            org.spongycastle.asn1.x509.AlgorithmIdentifier v2 = v9.getEncryptionAlgorithm();
        } catch (Exception v7_1) {
            throw v7_1;
        } catch (Exception v7_0) {
            org.spongycastle.openssl.PEMException v20_51 = new org.spongycastle.openssl.PEMException;
            v20_51(new StringBuilder().append("problem parsing ENCRYPTED PRIVATE KEY: ").append(v7_0.toString()).toString(), v7_0);
            throw v20_51;
        }
        if (org.spongycastle.openssl.PEMReader.access$400(this.this$0) != null) {
            org.spongycastle.openssl.PEMException v20_6;
            if (!org.spongycastle.openssl.PEMUtilities.isPKCS5Scheme2(v2.getAlgorithm())) {
                if (!org.spongycastle.openssl.PEMUtilities.isPKCS12(v2.getAlgorithm())) {
                    if (!org.spongycastle.openssl.PEMUtilities.isPKCS5Scheme1(v2.getAlgorithm())) {
                        throw new org.spongycastle.openssl.PEMException(new StringBuilder().append("Unknown algorithm: ").append(v2.getAlgorithm()).toString());
                    } else {
                        org.spongycastle.asn1.pkcs.PBEParameter v15_2 = org.spongycastle.asn1.pkcs.PBEParameter.getInstance(v2.getParameters());
                        String v4_2 = v2.getAlgorithm().getId();
                        javax.crypto.spec.PBEKeySpec v16_1 = new javax.crypto.spec.PBEKeySpec;
                        v16_1(org.spongycastle.openssl.PEMReader.access$400(this.this$0).getPassword());
                        javax.crypto.SecretKeyFactory v19_1 = javax.crypto.SecretKeyFactory.getInstance(v4_2, this.symProvider);
                        javax.crypto.spec.PBEParameterSpec v6_5 = new javax.crypto.spec.PBEParameterSpec(v15_2.getSalt(), v15_2.getIterationCount().intValue());
                        javax.crypto.Cipher v5_2 = javax.crypto.Cipher.getInstance(v4_2, this.symProvider);
                        v5_2.init(2, v19_1.generateSecret(v16_1), v6_5);
                        org.spongycastle.asn1.pkcs.PrivateKeyInfo v14_0 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Object.fromByteArray(v5_2.doFinal(v9.getEncryptedData())));
                        v20_6 = java.security.KeyFactory.getInstance(v14_0.getAlgorithmId().getAlgorithm().getId(), this.asymProvider).generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v14_0.getEncoded()));
                    }
                } else {
                    org.spongycastle.asn1.pkcs.PBEParameter v15_0 = org.spongycastle.asn1.pkcs.PKCS12PBEParams.getInstance(v2.getParameters());
                    String v4_0 = v2.getAlgorithm().getId();
                    javax.crypto.spec.PBEKeySpec v16_0 = new javax.crypto.spec.PBEKeySpec;
                    v16_0(org.spongycastle.openssl.PEMReader.access$400(this.this$0).getPassword());
                    javax.crypto.SecretKeyFactory v19_0 = javax.crypto.SecretKeyFactory.getInstance(v4_0, this.symProvider);
                    javax.crypto.spec.PBEParameterSpec v6_1 = new javax.crypto.spec.PBEParameterSpec(v15_0.getIV(), v15_0.getIterations().intValue());
                    javax.crypto.Cipher v5_0 = javax.crypto.Cipher.getInstance(v4_0, this.symProvider);
                    v5_0.init(2, v19_0.generateSecret(v16_0), v6_1);
                    org.spongycastle.asn1.pkcs.PrivateKeyInfo v14_1 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Object.fromByteArray(v5_0.doFinal(v9.getEncryptedData())));
                    v20_6 = java.security.KeyFactory.getInstance(v14_1.getAlgorithmId().getAlgorithm().getId(), this.asymProvider).generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v14_1.getEncoded()));
                }
            } else {
                org.spongycastle.asn1.pkcs.PBEParameter v15_1 = org.spongycastle.asn1.pkcs.PBES2Parameters.getInstance(v2.getParameters());
                org.spongycastle.asn1.pkcs.KeyDerivationFunc v8 = v15_1.getKeyDerivationFunc();
                org.spongycastle.asn1.pkcs.EncryptionScheme v18 = v15_1.getEncryptionScheme();
                javax.crypto.spec.PBEParameterSpec v6_3 = ((org.spongycastle.asn1.pkcs.PBKDF2Params) v8.getParameters());
                int v10 = v6_3.getIterationCount().intValue();
                byte[] v17 = v6_3.getSalt();
                String v4_1 = v18.getAlgorithm().getId();
                javax.crypto.SecretKey v11 = org.spongycastle.openssl.PEMUtilities.generateSecretKeyForPKCS5Scheme2(v4_1, org.spongycastle.openssl.PEMReader.access$400(this.this$0).getPassword(), v17, v10);
                javax.crypto.Cipher v5_1 = javax.crypto.Cipher.getInstance(v4_1, this.symProvider);
                java.security.AlgorithmParameters v3 = java.security.AlgorithmParameters.getInstance(v4_1, this.symProvider);
                v3.init(v18.getParameters().getDERObject().getEncoded());
                v5_1.init(2, v11, v3);
                org.spongycastle.asn1.pkcs.PrivateKeyInfo v14_2 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Object.fromByteArray(v5_1.doFinal(v9.getEncryptedData())));
                v20_6 = java.security.KeyFactory.getInstance(v14_2.getAlgorithmId().getAlgorithm().getId(), this.asymProvider).generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v14_2.getEncoded()));
            }
            return v20_6;
        } else {
            throw new org.spongycastle.openssl.PEMException("no PasswordFinder specified");
        }
    }

Method org.spongycastle.jce.provider.JDKPKCS12KeyStore.wrapKey() calling method javax.crypto.Cipher.getInstance()


    protected byte[] wrapKey(String p10, java.security.Key p11, org.spongycastle.asn1.pkcs.PKCS12PBEParams p12, char[] p13)
    {
        javax.crypto.spec.PBEKeySpec v5_1 = new javax.crypto.spec.PBEKeySpec(p13);
        try {
            javax.crypto.SecretKeyFactory v3 = javax.crypto.SecretKeyFactory.getInstance(p10, org.spongycastle.jce.provider.JDKPKCS12KeyStore.bcProvider);
            javax.crypto.spec.PBEParameterSpec v1_0 = new javax.crypto.spec.PBEParameterSpec(p12.getIV(), p12.getIterations().intValue());
            javax.crypto.Cipher v0 = javax.crypto.Cipher.getInstance(p10, org.spongycastle.jce.provider.JDKPKCS12KeyStore.bcProvider);
            v0.init(3, v3.generateSecret(v5_1), v1_0);
            return v0.wrap(p11);
        } catch (Exception v2) {
            throw new java.io.IOException(new StringBuilder().append("exception encrypting data - ").append(v2.toString()).toString());
        }
    }

Method org.spongycastle.jce.provider.JDKPKCS12KeyStore.unwrapKey() calling method javax.crypto.Cipher.getInstance()


    protected java.security.PrivateKey unwrapKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p14, byte[] p15, char[] p16, boolean p17)
    {
        String v1 = p14.getObjectId().getId();
        org.spongycastle.asn1.pkcs.PKCS12PBEParams v8_1 = new org.spongycastle.asn1.pkcs.PKCS12PBEParams(((org.spongycastle.asn1.ASN1Sequence) p14.getParameters()));
        javax.crypto.spec.PBEKeySpec v9_0 = new javax.crypto.spec.PBEKeySpec(p16);
        try {
            javax.crypto.SecretKeyFactory v6 = javax.crypto.SecretKeyFactory.getInstance(v1, org.spongycastle.jce.provider.JDKPKCS12KeyStore.bcProvider);
            javax.crypto.spec.PBEParameterSpec v3_1 = new javax.crypto.spec.PBEParameterSpec(v8_1.getIV(), v8_1.getIterations().intValue());
            javax.crypto.SecretKey v5 = v6.generateSecret(v9_0);
            ((org.spongycastle.jce.provider.JCEPBEKey) v5).setTryWrongPKCS12Zero(p17);
            javax.crypto.Cipher v2 = javax.crypto.Cipher.getInstance(v1, org.spongycastle.jce.provider.JDKPKCS12KeyStore.bcProvider);
            v2.init(4, v5, v3_1);
            return ((java.security.PrivateKey) v2.unwrap(p15, "", 2));
        } catch (Exception v4) {
            throw new java.io.IOException(new StringBuilder().append("exception unwrapping private key - ").append(v4.toString()).toString());
        }
    }

Method org.spongycastle.jce.provider.JDKPKCS12KeyStore.cryptData() calling method javax.crypto.Cipher.getInstance()


    protected byte[] cryptData(boolean p14, org.spongycastle.asn1.x509.AlgorithmIdentifier p15, char[] p16, boolean p17, byte[] p18)
    {
        String v1 = p15.getObjectId().getId();
        org.spongycastle.asn1.pkcs.PKCS12PBEParams v8_1 = new org.spongycastle.asn1.pkcs.PKCS12PBEParams(((org.spongycastle.asn1.ASN1Sequence) p15.getParameters()));
        javax.crypto.spec.PBEKeySpec v9_0 = new javax.crypto.spec.PBEKeySpec(p16);
        try {
            int v7;
            javax.crypto.SecretKeyFactory v6 = javax.crypto.SecretKeyFactory.getInstance(v1, org.spongycastle.jce.provider.JDKPKCS12KeyStore.bcProvider);
            javax.crypto.spec.PBEParameterSpec v3_1 = new javax.crypto.spec.PBEParameterSpec(v8_1.getIV(), v8_1.getIterations().intValue());
            org.spongycastle.jce.provider.JCEPBEKey v5_1 = ((org.spongycastle.jce.provider.JCEPBEKey) v6.generateSecret(v9_0));
            v5_1.setTryWrongPKCS12Zero(p17);
            javax.crypto.Cipher v2 = javax.crypto.Cipher.getInstance(v1, org.spongycastle.jce.provider.JDKPKCS12KeyStore.bcProvider);
        } catch (Exception v4) {
            throw new java.io.IOException(new StringBuilder().append("exception decrypting data - ").append(v4.toString()).toString());
        }
        if (!p14) {
            v7 = 2;
        } else {
            v7 = 1;
        }
        v2.init(v7, v5_1, v3_1);
        return v2.doFinal(p18);
    }

Method org.spongycastle.jce.provider.JDKKeyStore.makePBECipher() calling method javax.crypto.Cipher.getInstance()


    protected javax.crypto.Cipher makePBECipher(String p9, int p10, char[] p11, byte[] p12, int p13)
    {
        try {
            javax.crypto.spec.PBEKeySpec v4_1 = new javax.crypto.spec.PBEKeySpec(p11);
            javax.crypto.SecretKeyFactory v3 = javax.crypto.SecretKeyFactory.getInstance(p9, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            javax.crypto.spec.PBEParameterSpec v1_1 = new javax.crypto.spec.PBEParameterSpec(p12, p13);
            javax.crypto.Cipher v0 = javax.crypto.Cipher.getInstance(p9, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            v0.init(p10, v3.generateSecret(v4_1), v1_1);
            return v0;
        } catch (Exception v2) {
            throw new java.io.IOException(new StringBuilder().append("Error initialising store of key store: ").append(v2).toString());
        }
    }

Method com.tosan.fingerprint.KeyStoreHelper.getDecryptionCipher() calling method javax.crypto.Cipher.getInstance()


    public javax.crypto.Cipher getDecryptionCipher()
    {
        try {
            javax.crypto.Cipher v0 = javax.crypto.Cipher.getInstance("RSA/ECB/PKCS1Padding");
            v0.init(2, this.privateKey);
            return v0;
        } catch (java.security.InvalidKeyException v1_0) {
            throw v1_0;
        } catch (java.security.InvalidKeyException v1_1) {
            throw new com.tosan.fingerprint.KeyStoreHelperException(v1_1);
        } catch (java.security.InvalidKeyException v1_1) {
        } catch (java.security.InvalidKeyException v1_1) {
        }
    }

Method com.tosan.fingerprint.KeyStoreHelper.encryptData() calling method javax.crypto.Cipher.getInstance()


    public String encryptData(String p6)
    {
        try {
            javax.crypto.Cipher v0 = javax.crypto.Cipher.getInstance("RSA/ECB/PKCS1Padding");
            v0.init(1, this.publicKey);
            int v3_2 = new String(org.spongycastle.util.encoders.Base64.encode(v0.doFinal(p6.getBytes())));
        } catch (javax.crypto.IllegalBlockSizeException v2) {
            v3_2 = 0;
        } catch (javax.crypto.IllegalBlockSizeException v2) {
        } catch (javax.crypto.IllegalBlockSizeException v2) {
        } catch (javax.crypto.IllegalBlockSizeException v2) {
        } catch (javax.crypto.IllegalBlockSizeException v2) {
        }
        return v3_2;
    }

Method org.spongycastle.openssl.PKCS8Generator.generate() calling method javax.crypto.Cipher.doFinal()


    public org.spongycastle.util.io.pem.PemObject generate()
    {
        org.spongycastle.util.io.pem.PemGenerationException v13_16;
        byte[] v7 = this.key.getEncoded();
        if (this.algorithm != null) {
            org.spongycastle.asn1.DERObjectIdentifier v1_0 = new org.spongycastle.asn1.DERObjectIdentifier(this.algorithm);
            if (!org.spongycastle.openssl.PEMUtilities.isPKCS5Scheme2(v1_0)) {
                if (!org.spongycastle.openssl.PEMUtilities.isPKCS12(v1_0)) {
                    throw new org.spongycastle.util.io.pem.PemGenerationException(new StringBuilder().append("unknown algorithm: ").append(this.algorithm).toString());
                } else {
                    byte[] v10_0 = new byte[20];
                    if (this.random == null) {
                        this.random = new java.security.SecureRandom();
                    }
                    this.random.nextBytes(v10_0);
                    try {
                        this.cipher.init(1, this.secKeyFact.generateSecret(new javax.crypto.spec.PBEKeySpec(this.password)), new javax.crypto.spec.PBEParameterSpec(v10_0, this.iterationCount));
                        org.spongycastle.asn1.ASN1EncodableVector v12_3 = new org.spongycastle.asn1.ASN1EncodableVector();
                        v12_3.add(new org.spongycastle.asn1.DEROctetString(v10_0));
                        v12_3.add(new org.spongycastle.asn1.DERInteger(this.iterationCount));
                        v13_16 = new org.spongycastle.util.io.pem.PemObject("ENCRYPTED PRIVATE KEY", new org.spongycastle.asn1.pkcs.EncryptedPrivateKeyInfo(new org.spongycastle.asn1.x509.AlgorithmIdentifier(v1_0, new org.spongycastle.asn1.pkcs.PKCS12PBEParams(new org.spongycastle.asn1.DERSequence(v12_3))), this.cipher.doFinal(v7)).getEncoded());
                    } catch (java.security.GeneralSecurityException v3_3) {
                        throw new org.spongycastle.util.io.pem.PemGenerationException(v3_3.getMessage(), v3_3);
                    } catch (java.security.GeneralSecurityException v3_2) {
                        throw new org.spongycastle.util.io.pem.PemGenerationException(v3_2.getMessage(), v3_2);
                    }
                }
            } else {
                byte[] v10_1 = new byte[20];
                if (this.random == null) {
                    this.random = new java.security.SecureRandom();
                }
                this.random.nextBytes(v10_1);
                javax.crypto.SecretKey v6 = org.spongycastle.openssl.PEMUtilities.generateSecretKeyForPKCS5Scheme2(this.algorithm, this.password, v10_1, this.iterationCount);
                java.security.AlgorithmParameters v8 = this.paramGen.generateParameters();
                try {
                    this.cipher.init(1, v6, v8);
                    org.spongycastle.asn1.pkcs.EncryptionScheme v11_1 = new org.spongycastle.asn1.pkcs.EncryptionScheme(new org.spongycastle.asn1.DERObjectIdentifier(this.algorithm), org.spongycastle.asn1.ASN1Object.fromByteArray(v8.getEncoded()));
                    org.spongycastle.asn1.pkcs.KeyDerivationFunc v4_1 = new org.spongycastle.asn1.pkcs.KeyDerivationFunc(org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers.id_PBKDF2, new org.spongycastle.asn1.pkcs.PBKDF2Params(v10_1, this.iterationCount));
                    org.spongycastle.asn1.ASN1EncodableVector v12_1 = new org.spongycastle.asn1.ASN1EncodableVector();
                    v12_1.add(v4_1);
                    v12_1.add(v11_1);
                    org.spongycastle.asn1.DERSequence v16 = new org.spongycastle.asn1.DERSequence;
                    v16(v12_1);
                    v13_16 = new org.spongycastle.util.io.pem.PemObject("ENCRYPTED PRIVATE KEY", new org.spongycastle.asn1.pkcs.EncryptedPrivateKeyInfo(new org.spongycastle.asn1.x509.AlgorithmIdentifier(org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers.id_PBES2, new org.spongycastle.asn1.pkcs.PBES2Parameters(v16)), this.cipher.doFinal(v7)).getEncoded());
                } catch (java.security.GeneralSecurityException v3_1) {
                    throw new org.spongycastle.util.io.pem.PemGenerationException(v3_1.getMessage(), v3_1);
                } catch (java.security.GeneralSecurityException v3_0) {
                    throw new org.spongycastle.util.io.pem.PemGenerationException(v3_0.getMessage(), v3_0);
                }
            }
        } else {
            v13_16 = new org.spongycastle.util.io.pem.PemObject("PRIVATE KEY", v7);
        }
        return v13_16;
    }

Method org.spongycastle.openssl.PEMUtilities.crypt() calling method javax.crypto.Cipher.doFinal()


    static byte[] crypt(boolean p17, java.security.Provider p18, byte[] p19, char[] p20, String p21, byte[] p22)
    {
        javax.crypto.spec.RC2ParameterSpec v10_2 = new javax.crypto.spec.IvParameterSpec(p22);
        String v3 = "CBC";
        String v9 = "PKCS5Padding";
        if (p21.endsWith("-CFB")) {
            v3 = "CFB";
            v9 = "NoPadding";
        }
        if ((p21.endsWith("-ECB")) || (("DES-EDE".equals(p21)) || ("DES-EDE3".equals(p21)))) {
            v3 = "ECB";
            v10_2 = 0;
        }
        if (p21.endsWith("-OFB")) {
            v3 = "OFB";
            v9 = "NoPadding";
        }
        String v2;
        javax.crypto.SecretKey v11;
        if (!p21.startsWith("DES-EDE")) {
            if (!p21.startsWith("DES-")) {
                if (!p21.startsWith("BF-")) {
                    if (!p21.startsWith("RC2-")) {
                        if (!p21.startsWith("AES-")) {
                            throw new org.spongycastle.openssl.EncryptionException("unknown encryption with private key");
                        } else {
                            v2 = "AES";
                            byte[] v12 = p22;
                            if (p22.length > 8) {
                                v12 = new byte[8];
                                System.arraycopy(p22, 0, v12, 0, 8);
                            }
                            int v7_1;
                            if (!p21.startsWith("AES-128-")) {
                                if (!p21.startsWith("AES-192-")) {
                                    if (!p21.startsWith("AES-256-")) {
                                        throw new org.spongycastle.openssl.EncryptionException("unknown AES encryption with private key");
                                    } else {
                                        v7_1 = 256;
                                    }
                                } else {
                                    v7_1 = 192;
                                }
                            } else {
                                v7_1 = 128;
                            }
                            v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "AES", (v7_1 / 8), v12);
                        }
                    } else {
                        v2 = "RC2";
                        int v7_0 = 128;
                        if (!p21.startsWith("RC2-40-")) {
                            if (p21.startsWith("RC2-64-")) {
                                v7_0 = 64;
                            }
                        } else {
                            v7_0 = 40;
                        }
                        v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "RC2", (v7_0 / 8), p22);
                        if (v10_2 != null) {
                            v10_2 = new javax.crypto.spec.RC2ParameterSpec(v7_0, p22);
                        } else {
                            v10_2 = new javax.crypto.spec.RC2ParameterSpec(v7_0);
                        }
                    }
                } else {
                    v2 = "Blowfish";
                    v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "Blowfish", 16, p22);
                }
            } else {
                v2 = "DES";
                v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "DES", 8, p22);
            }
        } else {
            int v5;
            v2 = "DESede";
            if (p21.startsWith("DES-EDE3")) {
                v5 = 0;
            } else {
                v5 = 1;
            }
            v11 = org.spongycastle.openssl.PEMUtilities.getKey(p20, "DESede", 24, p22, v5);
        }
        try {
            int v8;
            javax.crypto.Cipher v4 = javax.crypto.Cipher.getInstance(new StringBuilder().append(v2).append("/").append(v3).append("/").append(v9).toString(), p18);
        } catch (Exception v6) {
            throw new org.spongycastle.openssl.EncryptionException("exception using cipher - please check password and data.", v6);
        }
        if (!p17) {
            v8 = 2;
        } else {
            v8 = 1;
        }
        if (v10_2 != null) {
            v4.init(v8, v11, v10_2);
        } else {
            v4.init(v8, v11);
        }
        return v4.doFinal(p19);
    }

Method org.spongycastle.openssl.PEMReader$EncryptedPrivateKeyParser.parseObject() calling method javax.crypto.Cipher.doFinal()


    public Object parseObject(org.spongycastle.util.io.pem.PemObject p24)
    {
        try {
            org.spongycastle.asn1.pkcs.EncryptedPrivateKeyInfo v9 = org.spongycastle.asn1.pkcs.EncryptedPrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Object.fromByteArray(p24.getContent()));
            org.spongycastle.asn1.x509.AlgorithmIdentifier v2 = v9.getEncryptionAlgorithm();
        } catch (Exception v7_1) {
            throw v7_1;
        } catch (Exception v7_0) {
            org.spongycastle.openssl.PEMException v20_51 = new org.spongycastle.openssl.PEMException;
            v20_51(new StringBuilder().append("problem parsing ENCRYPTED PRIVATE KEY: ").append(v7_0.toString()).toString(), v7_0);
            throw v20_51;
        }
        if (org.spongycastle.openssl.PEMReader.access$400(this.this$0) != null) {
            org.spongycastle.openssl.PEMException v20_6;
            if (!org.spongycastle.openssl.PEMUtilities.isPKCS5Scheme2(v2.getAlgorithm())) {
                if (!org.spongycastle.openssl.PEMUtilities.isPKCS12(v2.getAlgorithm())) {
                    if (!org.spongycastle.openssl.PEMUtilities.isPKCS5Scheme1(v2.getAlgorithm())) {
                        throw new org.spongycastle.openssl.PEMException(new StringBuilder().append("Unknown algorithm: ").append(v2.getAlgorithm()).toString());
                    } else {
                        org.spongycastle.asn1.pkcs.PBEParameter v15_2 = org.spongycastle.asn1.pkcs.PBEParameter.getInstance(v2.getParameters());
                        String v4_2 = v2.getAlgorithm().getId();
                        javax.crypto.spec.PBEKeySpec v16_1 = new javax.crypto.spec.PBEKeySpec;
                        v16_1(org.spongycastle.openssl.PEMReader.access$400(this.this$0).getPassword());
                        javax.crypto.SecretKeyFactory v19_1 = javax.crypto.SecretKeyFactory.getInstance(v4_2, this.symProvider);
                        javax.crypto.spec.PBEParameterSpec v6_5 = new javax.crypto.spec.PBEParameterSpec(v15_2.getSalt(), v15_2.getIterationCount().intValue());
                        javax.crypto.Cipher v5_2 = javax.crypto.Cipher.getInstance(v4_2, this.symProvider);
                        v5_2.init(2, v19_1.generateSecret(v16_1), v6_5);
                        org.spongycastle.asn1.pkcs.PrivateKeyInfo v14_0 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Object.fromByteArray(v5_2.doFinal(v9.getEncryptedData())));
                        v20_6 = java.security.KeyFactory.getInstance(v14_0.getAlgorithmId().getAlgorithm().getId(), this.asymProvider).generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v14_0.getEncoded()));
                    }
                } else {
                    org.spongycastle.asn1.pkcs.PBEParameter v15_0 = org.spongycastle.asn1.pkcs.PKCS12PBEParams.getInstance(v2.getParameters());
                    String v4_0 = v2.getAlgorithm().getId();
                    javax.crypto.spec.PBEKeySpec v16_0 = new javax.crypto.spec.PBEKeySpec;
                    v16_0(org.spongycastle.openssl.PEMReader.access$400(this.this$0).getPassword());
                    javax.crypto.SecretKeyFactory v19_0 = javax.crypto.SecretKeyFactory.getInstance(v4_0, this.symProvider);
                    javax.crypto.spec.PBEParameterSpec v6_1 = new javax.crypto.spec.PBEParameterSpec(v15_0.getIV(), v15_0.getIterations().intValue());
                    javax.crypto.Cipher v5_0 = javax.crypto.Cipher.getInstance(v4_0, this.symProvider);
                    v5_0.init(2, v19_0.generateSecret(v16_0), v6_1);
                    org.spongycastle.asn1.pkcs.PrivateKeyInfo v14_1 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Object.fromByteArray(v5_0.doFinal(v9.getEncryptedData())));
                    v20_6 = java.security.KeyFactory.getInstance(v14_1.getAlgorithmId().getAlgorithm().getId(), this.asymProvider).generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v14_1.getEncoded()));
                }
            } else {
                org.spongycastle.asn1.pkcs.PBEParameter v15_1 = org.spongycastle.asn1.pkcs.PBES2Parameters.getInstance(v2.getParameters());
                org.spongycastle.asn1.pkcs.KeyDerivationFunc v8 = v15_1.getKeyDerivationFunc();
                org.spongycastle.asn1.pkcs.EncryptionScheme v18 = v15_1.getEncryptionScheme();
                javax.crypto.spec.PBEParameterSpec v6_3 = ((org.spongycastle.asn1.pkcs.PBKDF2Params) v8.getParameters());
                int v10 = v6_3.getIterationCount().intValue();
                byte[] v17 = v6_3.getSalt();
                String v4_1 = v18.getAlgorithm().getId();
                javax.crypto.SecretKey v11 = org.spongycastle.openssl.PEMUtilities.generateSecretKeyForPKCS5Scheme2(v4_1, org.spongycastle.openssl.PEMReader.access$400(this.this$0).getPassword(), v17, v10);
                javax.crypto.Cipher v5_1 = javax.crypto.Cipher.getInstance(v4_1, this.symProvider);
                java.security.AlgorithmParameters v3 = java.security.AlgorithmParameters.getInstance(v4_1, this.symProvider);
                v3.init(v18.getParameters().getDERObject().getEncoded());
                v5_1.init(2, v11, v3);
                org.spongycastle.asn1.pkcs.PrivateKeyInfo v14_2 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Object.fromByteArray(v5_1.doFinal(v9.getEncryptedData())));
                v20_6 = java.security.KeyFactory.getInstance(v14_2.getAlgorithmId().getAlgorithm().getId(), this.asymProvider).generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v14_2.getEncoded()));
            }
            return v20_6;
        } else {
            throw new org.spongycastle.openssl.PEMException("no PasswordFinder specified");
        }
    }

Method org.spongycastle.jce.provider.JDKPKCS12KeyStore.cryptData() calling method javax.crypto.Cipher.doFinal()


    protected byte[] cryptData(boolean p14, org.spongycastle.asn1.x509.AlgorithmIdentifier p15, char[] p16, boolean p17, byte[] p18)
    {
        String v1 = p15.getObjectId().getId();
        org.spongycastle.asn1.pkcs.PKCS12PBEParams v8_1 = new org.spongycastle.asn1.pkcs.PKCS12PBEParams(((org.spongycastle.asn1.ASN1Sequence) p15.getParameters()));
        javax.crypto.spec.PBEKeySpec v9_0 = new javax.crypto.spec.PBEKeySpec(p16);
        try {
            int v7;
            javax.crypto.SecretKeyFactory v6 = javax.crypto.SecretKeyFactory.getInstance(v1, org.spongycastle.jce.provider.JDKPKCS12KeyStore.bcProvider);
            javax.crypto.spec.PBEParameterSpec v3_1 = new javax.crypto.spec.PBEParameterSpec(v8_1.getIV(), v8_1.getIterations().intValue());
            org.spongycastle.jce.provider.JCEPBEKey v5_1 = ((org.spongycastle.jce.provider.JCEPBEKey) v6.generateSecret(v9_0));
            v5_1.setTryWrongPKCS12Zero(p17);
            javax.crypto.Cipher v2 = javax.crypto.Cipher.getInstance(v1, org.spongycastle.jce.provider.JDKPKCS12KeyStore.bcProvider);
        } catch (Exception v4) {
            throw new java.io.IOException(new StringBuilder().append("exception decrypting data - ").append(v4.toString()).toString());
        }
        if (!p14) {
            v7 = 2;
        } else {
            v7 = 1;
        }
        v2.init(v7, v5_1, v3_1);
        return v2.doFinal(p18);
    }

Method com.tosan.fingerprint.KeyStoreHelper.encryptData() calling method javax.crypto.Cipher.doFinal()


    public String encryptData(String p6)
    {
        try {
            javax.crypto.Cipher v0 = javax.crypto.Cipher.getInstance("RSA/ECB/PKCS1Padding");
            v0.init(1, this.publicKey);
            int v3_2 = new String(org.spongycastle.util.encoders.Base64.encode(v0.doFinal(p6.getBytes())));
        } catch (javax.crypto.IllegalBlockSizeException v2) {
            v3_2 = 0;
        } catch (javax.crypto.IllegalBlockSizeException v2) {
        } catch (javax.crypto.IllegalBlockSizeException v2) {
        } catch (javax.crypto.IllegalBlockSizeException v2) {
        } catch (javax.crypto.IllegalBlockSizeException v2) {
        }
        return v3_2;
    }

Method com.tosan.fingerprint.KeyStoreHelper.decryptData() calling method javax.crypto.Cipher.doFinal()


    public String decryptData(String p5, javax.crypto.Cipher p6)
    {
        try {
            int v2_1 = new String(p6.doFinal(org.spongycastle.util.encoders.Base64.decode(p5.getBytes())));
        } catch (javax.crypto.IllegalBlockSizeException v1) {
            v2_1 = 0;
        } catch (javax.crypto.IllegalBlockSizeException v1) {
        }
        return v2_1;
    }

Method org.spongycastle.openssl.PEMUtilities.getKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private static javax.crypto.SecretKey getKey(char[] p6, String p7, int p8, byte[] p9, boolean p10)
    {
        org.spongycastle.crypto.generators.OpenSSLPBEParametersGenerator v2_1 = new org.spongycastle.crypto.generators.OpenSSLPBEParametersGenerator();
        v2_1.init(org.spongycastle.crypto.PBEParametersGenerator.PKCS5PasswordToBytes(p6), p9);
        byte[] v0 = ((org.spongycastle.crypto.params.KeyParameter) v2_1.generateDerivedParameters((p8 * 8))).getKey();
        if ((p10) && (v0.length >= 24)) {
            System.arraycopy(v0, 0, v0, 16, 8);
        }
        return new javax.crypto.spec.SecretKeySpec(v0, p7);
    }

Method org.spongycastle.openssl.PEMUtilities.generateSecretKeyForPKCS5Scheme2() calling method javax.crypto.spec.SecretKeySpec.<init>()


    static javax.crypto.SecretKey generateSecretKeyForPKCS5Scheme2(String p3, char[] p4, byte[] p5, int p6)
    {
        org.spongycastle.crypto.generators.PKCS5S2ParametersGenerator v0_1 = new org.spongycastle.crypto.generators.PKCS5S2ParametersGenerator();
        v0_1.init(org.spongycastle.crypto.PBEParametersGenerator.PKCS5PasswordToBytes(p4), p5, p6);
        return new javax.crypto.spec.SecretKeySpec(((org.spongycastle.crypto.params.KeyParameter) v0_1.generateDerivedParameters(org.spongycastle.openssl.PEMUtilities.getKeySize(p3))).getKey(), p3);
    }

Method org.spongycastle.jce.provider.symmetric.DESede$KeyGenerator.engineGenerateKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateKey()
    {
        if (this.uninitialised) {
            this.engine.init(new org.spongycastle.crypto.KeyGenerationParameters(new java.security.SecureRandom(), this.defaultKeySize));
            this.uninitialised = 0;
        }
        javax.crypto.spec.SecretKeySpec v1_3;
        if (this.keySizeSet) {
            v1_3 = new javax.crypto.spec.SecretKeySpec(this.engine.generateKey(), this.algName);
        } else {
            byte[] v0 = this.engine.generateKey();
            System.arraycopy(v0, 0, v0, 16, 8);
            v1_3 = new javax.crypto.spec.SecretKeySpec(v0, this.algName);
        }
        return v1_3;
    }

Method org.spongycastle.jce.provider.symmetric.DESede$KeyFactory.engineGetKeySpec() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey p7, Class p8)
    {
        if (p8 != null) {
            if (p7 != null) {
                javax.crypto.spec.DESedeKeySpec v3_4;
                if (!javax.crypto.spec.SecretKeySpec.isAssignableFrom(p8)) {
                    if (!javax.crypto.spec.DESedeKeySpec.isAssignableFrom(p8)) {
                        throw new java.security.spec.InvalidKeySpecException("Invalid KeySpec");
                    } else {
                        byte[] v0 = p7.getEncoded();
                        try {
                            if (v0.length != 16) {
                                v3_4 = new javax.crypto.spec.DESedeKeySpec(v0);
                            } else {
                                byte[] v2 = new byte[24];
                                System.arraycopy(v0, 0, v2, 0, 16);
                                System.arraycopy(v0, 0, v2, 16, 8);
                                v3_4 = new javax.crypto.spec.DESedeKeySpec(v2);
                            }
                        } catch (Exception v1) {
                            throw new java.security.spec.InvalidKeySpecException(v1.toString());
                        }
                    }
                } else {
                    v3_4 = new javax.crypto.spec.SecretKeySpec(p7.getEncoded(), this.algName);
                }
                return v3_4;
            } else {
                throw new java.security.spec.InvalidKeySpecException("key parameter is null");
            }
        } else {
            throw new java.security.spec.InvalidKeySpecException("keySpec parameter is null");
        }
    }

Method org.spongycastle.jce.provider.symmetric.DESede$KeyFactory.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(java.security.spec.KeySpec p5)
    {
        javax.crypto.SecretKey v1_1;
        if (!(p5 instanceof javax.crypto.spec.DESedeKeySpec)) {
            v1_1 = super.engineGenerateSecret(p5);
        } else {
            v1_1 = new javax.crypto.spec.SecretKeySpec(((javax.crypto.spec.DESedeKeySpec) p5).getKey(), "DESede");
        }
        return v1_1;
    }

Method org.spongycastle.jce.provider.asymmetric.ec.KeyAgreement.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(String p8)
    {
        byte[] v3 = this.bigIntToBytes(this.result);
        if (this.kdf != null) {
            if (org.spongycastle.jce.provider.asymmetric.ec.KeyAgreement.algorithms.containsKey(p8)) {
                int v1 = ((Integer) org.spongycastle.jce.provider.asymmetric.ec.KeyAgreement.algorithms.get(p8)).intValue();
                byte[] v0 = new byte[(v1 / 8)];
                this.kdf.init(new org.spongycastle.crypto.agreement.kdf.DHKDFParameters(new org.spongycastle.asn1.DERObjectIdentifier(p8), v1, v3));
                this.kdf.generateBytes(v0, 0, v0.length);
                v3 = v0;
            } else {
                throw new java.security.NoSuchAlgorithmException(new StringBuilder().append("unknown algorithm encountered: ").append(p8).toString());
            }
        }
        return new javax.crypto.spec.SecretKeySpec(v3, p8);
    }

Method org.spongycastle.jce.provider.JDKKeyStore.decodeKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private java.security.Key decodeKey(java.io.DataInputStream p10)
    {
        java.security.spec.X509EncodedKeySpec v5_1;
        java.io.IOException v6_13;
        int v4 = p10.read();
        String v3 = p10.readUTF();
        String v0 = p10.readUTF();
        byte[] v2 = new byte[p10.readInt()];
        p10.readFully(v2);
        if ((!v3.equals("PKCS#8")) && (!v3.equals("PKCS8"))) {
            if ((!v3.equals("X.509")) && (!v3.equals("X509"))) {
                if (!v3.equals("RAW")) {
                    throw new java.io.IOException(new StringBuilder().append("Key format ").append(v3).append(" not recognised!").toString());
                } else {
                    v6_13 = new javax.crypto.spec.SecretKeySpec(v2, v0);
                }
            } else {
                v5_1 = new java.security.spec.X509EncodedKeySpec(v2);
                try {
                    switch (v4) {
                        case 0:
                            v6_13 = java.security.KeyFactory.getInstance(v0, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME).generatePrivate(v5_1);
                            break;
                        case 1:
                            v6_13 = java.security.KeyFactory.getInstance(v0, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME).generatePublic(v5_1);
                            break;
                        case 2:
                            v6_13 = javax.crypto.SecretKeyFactory.getInstance(v0, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME).generateSecret(v5_1);
                            break;
                        default:
                            throw new java.io.IOException(new StringBuilder().append("Key type ").append(v4).append(" not recognised!").toString());
                    }
                } catch (Exception v1) {
                }
                throw new java.io.IOException(new StringBuilder().append("Exception creating key: ").append(v1.toString()).toString());
            }
        } else {
            v5_1 = new java.security.spec.PKCS8EncodedKeySpec(v2);
        }
        return v6_13;
    }

Method org.spongycastle.jce.provider.JCESecretKeyFactory$DES.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(java.security.spec.KeySpec p5)
    {
        javax.crypto.SecretKey v1_1;
        if (!(p5 instanceof javax.crypto.spec.DESKeySpec)) {
            v1_1 = super.engineGenerateSecret(p5);
        } else {
            v1_1 = new javax.crypto.spec.SecretKeySpec(((javax.crypto.spec.DESKeySpec) p5).getKey(), "DES");
        }
        return v1_1;
    }

Method org.spongycastle.jce.provider.JCESecretKeyFactory.engineTranslateKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineTranslateKey(javax.crypto.SecretKey p4)
    {
        if (p4 != null) {
            if (p4.getAlgorithm().equalsIgnoreCase(this.algName)) {
                return new javax.crypto.spec.SecretKeySpec(p4.getEncoded(), this.algName);
            } else {
                throw new java.security.InvalidKeyException(new StringBuilder().append("Key not of type ").append(this.algName).append(".").toString());
            }
        } else {
            throw new java.security.InvalidKeyException("key parameter is null");
        }
    }

Method org.spongycastle.jce.provider.JCESecretKeyFactory.engineGetKeySpec() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey p8, Class p9)
    {
        if (p9 != null) {
            if (p8 != null) {
                java.security.spec.InvalidKeySpecException v4_4;
                if (!javax.crypto.spec.SecretKeySpec.isAssignableFrom(p9)) {
                    try {
                        Class[] v3 = new Class[1];
                        v3[0] = byte[];
                        reflect.Constructor v0 = p9.getConstructor(v3);
                        Object[] v2 = new Object[1];
                        v2[0] = p8.getEncoded();
                        v4_4 = ((java.security.spec.KeySpec) v0.newInstance(v2));
                    } catch (Exception v1) {
                        throw new java.security.spec.InvalidKeySpecException(v1.toString());
                    }
                } else {
                    v4_4 = new javax.crypto.spec.SecretKeySpec(p8.getEncoded(), this.algName);
                }
                return v4_4;
            } else {
                throw new java.security.spec.InvalidKeySpecException("key parameter is null");
            }
        } else {
            throw new java.security.spec.InvalidKeySpecException("keySpec parameter is null");
        }
    }

Method org.spongycastle.jce.provider.JCEKeyGenerator.engineGenerateKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateKey()
    {
        if (this.uninitialised) {
            this.engine.init(new org.spongycastle.crypto.KeyGenerationParameters(new java.security.SecureRandom(), this.defaultKeySize));
            this.uninitialised = 0;
        }
        return new javax.crypto.spec.SecretKeySpec(this.engine.generateKey(), this.algName);
    }

Method org.spongycastle.jce.provider.JCEDHKeyAgreement.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(String p7)
    {
        if (this.x != null) {
            javax.crypto.spec.SecretKeySpec v4_3;
            String v0 = org.spongycastle.util.Strings.toUpperCase(p7);
            byte[] v3 = this.bigIntToBytes(this.result);
            if (!org.spongycastle.jce.provider.JCEDHKeyAgreement.algorithms.containsKey(v0)) {
                v4_3 = new javax.crypto.spec.SecretKeySpec(v3, p7);
            } else {
                byte[] v1 = new byte[(((Integer) org.spongycastle.jce.provider.JCEDHKeyAgreement.algorithms.get(v0)).intValue() / 8)];
                System.arraycopy(v3, 0, v1, 0, v1.length);
                if (v0.startsWith("DES")) {
                    org.spongycastle.crypto.params.DESParameters.setOddParity(v1);
                }
                v4_3 = new javax.crypto.spec.SecretKeySpec(v1, p7);
            }
            return v4_3;
        } else {
            throw new IllegalStateException("Diffie-Hellman not initialised.");
        }
    }

Method org.spongycastle.jce.provider.WrapCipherSpi.engineUnwrap() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key engineUnwrap(byte[] p13, String p14, int p15)
    {
        try {
            byte[] v3;
            if (this.wrapEngine != null) {
                v3 = this.wrapEngine.unwrap(p13, 0, p13.length);
            } else {
                v3 = this.engineDoFinal(p13, 0, p13.length);
            }
        } catch (Exception v1_1) {
            throw new java.security.InvalidKeyException(v1_1.getMessage());
        } catch (Exception v1_0) {
            throw new java.security.InvalidKeyException(v1_0.getMessage());
        } catch (java.security.spec.InvalidKeySpecException v2_1) {
            throw new java.security.InvalidKeyException(v2_1.getMessage());
        }
        org.spongycastle.jce.provider.JCERSAPrivateCrtKey v7_1;
        if (p15 != 3) {
            if ((!p14.equals("")) || (p15 != 2)) {
                try {
                    java.security.KeyFactory v5 = java.security.KeyFactory.getInstance(p14, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
                } catch (Exception v1_3) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v1_3.getMessage()).toString());
                } catch (Exception v1_2) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v1_2.getMessage()).toString());
                } catch (java.security.spec.InvalidKeySpecException v2_0) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v2_0.getMessage()).toString());
                }
                if (p15 != 1) {
                    if (p15 != 2) {
                        throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(p15).toString());
                    } else {
                        v7_1 = v5.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v3));
                    }
                } else {
                    v7_1 = v5.generatePublic(new java.security.spec.X509EncodedKeySpec(v3));
                }
            } else {
                try {
                    org.spongycastle.asn1.pkcs.PrivateKeyInfo v4_1 = new org.spongycastle.asn1.pkcs.PrivateKeyInfo(((org.spongycastle.asn1.ASN1Sequence) new org.spongycastle.asn1.ASN1InputStream(v3).readObject()));
                    org.spongycastle.asn1.DERObjectIdentifier v6 = v4_1.getAlgorithmId().getObjectId();
                } catch (Exception v1) {
                    throw new java.security.InvalidKeyException("Invalid key encoding.");
                }
                if (!v6.equals(org.spongycastle.asn1.x9.X9ObjectIdentifiers.id_ecPublicKey)) {
                    if (!v6.equals(org.spongycastle.asn1.cryptopro.CryptoProObjectIdentifiers.gostR3410_94)) {
                        if (!v6.equals(org.spongycastle.asn1.x9.X9ObjectIdentifiers.id_dsa)) {
                            if (!v6.equals(org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers.dhKeyAgreement)) {
                                if (!v6.equals(org.spongycastle.asn1.x9.X9ObjectIdentifiers.dhpublicnumber)) {
                                    v7_1 = new org.spongycastle.jce.provider.JCERSAPrivateCrtKey(v4_1);
                                } else {
                                    v7_1 = new org.spongycastle.jce.provider.JCEDHPrivateKey(v4_1);
                                }
                            } else {
                                v7_1 = new org.spongycastle.jce.provider.JCEDHPrivateKey(v4_1);
                            }
                        } else {
                            v7_1 = new org.spongycastle.jce.provider.JDKDSAPrivateKey(v4_1);
                        }
                    } else {
                        v7_1 = new org.spongycastle.jce.provider.JDKGOST3410PrivateKey(v4_1);
                    }
                } else {
                    v7_1 = new org.spongycastle.jce.provider.JCEECPrivateKey(v4_1);
                }
            }
        } else {
            v7_1 = new javax.crypto.spec.SecretKeySpec(v3, p14);
        }
        return v7_1;
    }

Method org.spongycastle.jce.provider.BrokenJCEBlockCipher.engineUnwrap() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key engineUnwrap(byte[] p8, String p9, int p10)
    {
        try {
            java.security.InvalidKeyException v4_11;
            byte[] v2 = this.engineDoFinal(p8, 0, p8.length);
        } catch (java.security.NoSuchAlgorithmException v0_0) {
            throw new java.security.InvalidKeyException(v0_0.getMessage());
        } catch (java.security.spec.InvalidKeySpecException v1_1) {
            throw new java.security.InvalidKeyException(v1_1.getMessage());
        }
        if (p10 != 3) {
            try {
                java.security.KeyFactory v3 = java.security.KeyFactory.getInstance(p9, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
            } catch (java.security.NoSuchAlgorithmException v0_2) {
                throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_2.getMessage()).toString());
            } catch (java.security.NoSuchAlgorithmException v0_1) {
                throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_1.getMessage()).toString());
            } catch (java.security.spec.InvalidKeySpecException v1_0) {
                throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v1_0.getMessage()).toString());
            }
            if (p10 != 1) {
                if (p10 != 2) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(p10).toString());
                } else {
                    v4_11 = v3.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v2));
                }
            } else {
                v4_11 = v3.generatePublic(new java.security.spec.X509EncodedKeySpec(v2));
            }
        } else {
            v4_11 = new javax.crypto.spec.SecretKeySpec(v2, p9);
        }
        return v4_11;
    }