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.cms.jcajce.JceCMSContentEncryptorBuilder$CMSOutputEncryptor.<init>() calling method javax.crypto.KeyGenerator.generateKey()


    JceCMSContentEncryptorBuilder$CMSOutputEncryptor(org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder p7, org.spongycastle.asn1.ASN1ObjectIdentifier p8, int p9, java.security.SecureRandom p10)
    {
        this.this$0 = p7;
        javax.crypto.KeyGenerator v1 = org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder.access$000(p7).createKeyGenerator(p8);
        if (p10 == null) {
            p10 = new java.security.SecureRandom();
        }
        if (p9 >= 0) {
            v1.init(p9, p10);
        } else {
            v1.init(p10);
        }
        this.cipher = org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder.access$000(p7).createCipher(p8);
        this.encKey = v1.generateKey();
        java.security.AlgorithmParameters v2 = org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder.access$000(p7).generateParameters(p8, this.encKey, p10);
        try {
            this.cipher.init(1, this.encKey, v2, p10);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("unable to initialize cipher: ").append(v0.getMessage()).toString(), v0);
        }
        if (v2 == null) {
            v2 = this.cipher.getParameters();
        }
        this.algorithmIdentifier = org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder.access$000(p7).getAlgorithmIdentifier(p8, v2);
        return;
    }

Method okio.Buffer.hmac() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private okio.ByteString hmac(String p8, okio.ByteString p9)
    {
        try {
            javax.crypto.Mac v1 = javax.crypto.Mac.getInstance(p8);
            v1.init(new javax.crypto.spec.SecretKeySpec(p9.toByteArray(), p8));
        } catch (java.security.InvalidKeyException v0) {
            throw new AssertionError();
        } catch (java.security.InvalidKeyException v0) {
            throw new IllegalArgumentException(v0);
        }
        if (this.head != null) {
            v1.update(this.head.data, this.head.pos, (this.head.limit - this.head.pos));
            okio.Segment v2 = this.head.next;
            while (v2 != this.head) {
                v1.update(v2.data, v2.pos, (v2.limit - v2.pos));
                v2 = v2.next;
            }
        }
        return okio.ByteString.of(v1.doFinal());
    }

Method okio.ByteString.hmac() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private okio.ByteString hmac(String p5, okio.ByteString p6)
    {
        try {
            javax.crypto.Mac v1 = javax.crypto.Mac.getInstance(p5);
            v1.init(new javax.crypto.spec.SecretKeySpec(p6.toByteArray(), p5));
            return okio.ByteString.of(v1.doFinal(this.data));
        } catch (java.security.InvalidKeyException v0_1) {
            throw new AssertionError(v0_1);
        } catch (java.security.InvalidKeyException v0_0) {
            throw new IllegalArgumentException(v0_0);
        }
    }

Method okio.HashingSink.<init>() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private HashingSink(okio.Sink p5, okio.ByteString p6, String p7)
    {
        super(p5);
        try {
            super.mac = javax.crypto.Mac.getInstance(p7);
            super.mac.init(new javax.crypto.spec.SecretKeySpec(p6.toByteArray(), p7));
            super.messageDigest = 0;
            return;
        } catch (java.security.InvalidKeyException v0) {
            throw new AssertionError();
        } catch (java.security.InvalidKeyException v0) {
            throw new IllegalArgumentException(v0);
        }
    }

Method okio.HashingSource.<init>() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private HashingSource(okio.Source p5, okio.ByteString p6, String p7)
    {
        super(p5);
        try {
            super.mac = javax.crypto.Mac.getInstance(p7);
            super.mac.init(new javax.crypto.spec.SecretKeySpec(p6.toByteArray(), p7));
            super.messageDigest = 0;
            return;
        } catch (java.security.InvalidKeyException v0) {
            throw new AssertionError();
        } catch (java.security.InvalidKeyException v0) {
            throw new IllegalArgumentException(v0);
        }
    }

Method org.apache.xml.security.signature.SignedInfo.createSecretKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public javax.crypto.SecretKey createSecretKey(byte[] p3)
    {
        return new javax.crypto.spec.SecretKeySpec(p3, this._signatureAlgorithm.getJCEAlgorithmString());
    }

Method org.spongycastle.cert.crmf.jcajce.JceAsymmetricValueDecryptorGenerator.extractSecretKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private java.security.Key extractSecretKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p7, org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9)
    {
        try {
            javax.crypto.Cipher v1 = this.helper.createCipher(p7.getAlgorithm());
            try {
                v1.init(4, this.recipientKey);
                java.security.Key v2_0 = v1.unwrap(p9, p8.getAlgorithm().getId(), 3);
                java.security.Key v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            }
            java.security.Key v2_1;
            if (v3 != null) {
                v2_1 = v3;
            } else {
                try {
                    v1.init(2, this.recipientKey);
                    v2_1 = new javax.crypto.spec.SecretKeySpec(v1.doFinal(p9), p8.getAlgorithm().getId());
                } catch (javax.crypto.BadPaddingException v0_2) {
                    throw new org.spongycastle.cert.crmf.CRMFException("key invalid in message.", v0_2);
                } catch (javax.crypto.BadPaddingException v0_1) {
                    throw new org.spongycastle.cert.crmf.CRMFException("illegal blocksize in message.", v0_1);
                } catch (javax.crypto.BadPaddingException v0_0) {
                    throw new org.spongycastle.cert.crmf.CRMFException("bad padding in message.", v0_0);
                }
            }
            return v2_1;
        } catch (javax.crypto.BadPaddingException v0_2) {
        } catch (javax.crypto.BadPaddingException v0_1) {
        } catch (javax.crypto.BadPaddingException v0_0) {
        }
    }

Method org.spongycastle.cert.crmf.jcajce.JcePKMACValuesCalculator.calculateMac() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public byte[] calculateMac(byte[] p5, byte[] p6)
    {
        try {
            this.mac.init(new javax.crypto.spec.SecretKeySpec(p5, this.mac.getAlgorithm()));
            return this.mac.doFinal(p6);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cert.crmf.CRMFException(new StringBuilder().append("failure in setup: ").append(v0.getMessage()).toString(), v0);
        }
    }

Method org.spongycastle.cms.jcajce.EnvelopedDataHelper.getJceKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    java.security.Key getJceKey(org.spongycastle.asn1.ASN1ObjectIdentifier p4, org.spongycastle.operator.GenericKey p5)
    {
        IllegalArgumentException v0_6;
        if (!(p5.getRepresentation() instanceof java.security.Key)) {
            if (!(p5.getRepresentation() instanceof byte[])) {
                throw new IllegalArgumentException("unknown generic key type");
            } else {
                v0_6 = new javax.crypto.spec.SecretKeySpec(((byte[]) ((byte[]) p5.getRepresentation())), this.getBaseCipherName(p4));
            }
        } else {
            v0_6 = ((java.security.Key) p5.getRepresentation());
        }
        return v0_6;
    }

Method org.spongycastle.cms.jcajce.EnvelopedDataHelper.getJceKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    java.security.Key getJceKey(org.spongycastle.operator.GenericKey p4)
    {
        IllegalArgumentException v0_5;
        if (!(p4.getRepresentation() instanceof java.security.Key)) {
            if (!(p4.getRepresentation() instanceof byte[])) {
                throw new IllegalArgumentException("unknown generic key type");
            } else {
                v0_5 = new javax.crypto.spec.SecretKeySpec(((byte[]) ((byte[]) p4.getRepresentation())), "ENC");
            }
        } else {
            v0_5 = ((java.security.Key) p4.getRepresentation());
        }
        return v0_5;
    }

Method org.spongycastle.cms.jcajce.JcePasswordRecipient.extractSecretKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key extractSecretKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p7, org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9, byte[] p10)
    {
        javax.crypto.Cipher v2 = this.helper.createRFC3211Wrapper(p7.getAlgorithm());
        try {
            v2.init(4, new javax.crypto.spec.SecretKeySpec(p9, v2.getAlgorithm()), new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(p7.getParameters()).getOctets()));
            return v2.unwrap(p10, p8.getAlgorithm().getId(), 3);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("cannot process content encryption key: ").append(v0.getMessage()).toString(), v0);
        }
    }

Method org.spongycastle.cms.jcajce.JcePasswordRecipientInfoGenerator.generateEncryptedBytes() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public byte[] generateEncryptedBytes(org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9, org.spongycastle.operator.GenericKey p10)
    {
        java.security.Key v0 = this.helper.getJceKey(p10);
        javax.crypto.Cipher v3 = this.helper.createRFC3211Wrapper(p8.getAlgorithm());
        try {
            v3.init(3, new javax.crypto.spec.SecretKeySpec(p9, v3.getAlgorithm()), new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(p8.getParameters()).getOctets()));
            return v3.wrap(v0);
        } catch (java.security.GeneralSecurityException v1) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("cannot process content encryption key: ").append(v1.getMessage()).toString(), v1);
        }
    }

Method org.spongycastle.jcajce.provider.asymmetric.dh.KeyAgreementSpi.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.jcajce.provider.asymmetric.dh.KeyAgreementSpi.algorithms.containsKey(v0)) {
                v4_3 = new javax.crypto.spec.SecretKeySpec(v3, p7);
            } else {
                byte[] v1 = new byte[(((Integer) org.spongycastle.jcajce.provider.asymmetric.dh.KeyAgreementSpi.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.jcajce.provider.asymmetric.ec.KeyAgreementSpi.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.jcajce.provider.asymmetric.ec.KeyAgreementSpi.algorithms.containsKey(p8)) {
                int v1 = ((Integer) org.spongycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi.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.jcajce.provider.asymmetric.util.BaseCipherSpi.engineUnwrap() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key engineUnwrap(byte[] p11, String p12, int p13)
    {
        try {
            byte[] v2;
            if (this.wrapEngine != null) {
                v2 = this.wrapEngine.unwrap(p11, 0, p11.length);
            } else {
                v2 = this.engineDoFinal(p11, 0, p11.length);
            }
        } catch (Exception v0_1) {
            throw new java.security.InvalidKeyException(v0_1.getMessage());
        } catch (Exception 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());
        }
        java.security.PrivateKey v5_0;
        if (p13 != 3) {
            if ((!p12.equals("")) || (p13 != 2)) {
                try {
                    java.security.KeyFactory v4 = java.security.KeyFactory.getInstance(p12, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
                } catch (Exception v0_3) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_3.getMessage()).toString());
                } catch (Exception v0_2) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_2.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 (p13 != 1) {
                    if (p13 != 2) {
                        throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(p13).toString());
                    } else {
                        v5_0 = v4.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v2));
                    }
                } else {
                    v5_0 = v4.generatePublic(new java.security.spec.X509EncodedKeySpec(v2));
                }
            } else {
                try {
                    org.spongycastle.asn1.pkcs.PrivateKeyInfo v3 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(v2);
                    v5_0 = org.spongycastle.jce.provider.BouncyCastleProvider.getPrivateKey(v3);
                } catch (Exception v0) {
                    throw new java.security.InvalidKeyException("Invalid key encoding.");
                }
                if (v5_0 == null) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("algorithm ").append(v3.getPrivateKeyAlgorithm().getAlgorithm()).append(" not supported").toString());
                }
            }
        } else {
            v5_0 = new javax.crypto.spec.SecretKeySpec(v2, p12);
        }
        return v5_0;
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseKeyGenerator.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.jcajce.provider.symmetric.util.BaseWrapCipher.engineUnwrap() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key engineUnwrap(byte[] p11, String p12, int p13)
    {
        try {
            byte[] v2;
            if (this.wrapEngine != null) {
                v2 = this.wrapEngine.unwrap(p11, 0, p11.length);
            } else {
                v2 = this.engineDoFinal(p11, 0, p11.length);
            }
        } catch (Exception v0_1) {
            throw new java.security.InvalidKeyException(v0_1.getMessage());
        } catch (Exception 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());
        }
        java.security.PrivateKey v5_0;
        if (p13 != 3) {
            if ((!p12.equals("")) || (p13 != 2)) {
                try {
                    java.security.KeyFactory v4 = java.security.KeyFactory.getInstance(p12, org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
                } catch (Exception v0_3) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_3.getMessage()).toString());
                } catch (Exception v0_2) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_2.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 (p13 != 1) {
                    if (p13 != 2) {
                        throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(p13).toString());
                    } else {
                        v5_0 = v4.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v2));
                    }
                } else {
                    v5_0 = v4.generatePublic(new java.security.spec.X509EncodedKeySpec(v2));
                }
            } else {
                try {
                    org.spongycastle.asn1.pkcs.PrivateKeyInfo v3 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(v2);
                    v5_0 = org.spongycastle.jce.provider.BouncyCastleProvider.getPrivateKey(v3);
                } catch (Exception v0) {
                    throw new java.security.InvalidKeyException("Invalid key encoding.");
                }
                if (v5_0 == null) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("algorithm ").append(v3.getPrivateKeyAlgorithm().getAlgorithm()).append(" not supported").toString());
                }
            }
        } else {
            v5_0 = new javax.crypto.spec.SecretKeySpec(v2, p12);
        }
        return v5_0;
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseSecretKeyFactory.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.jcajce.provider.symmetric.util.BaseSecretKeyFactory.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.jcajce.provider.symmetric.DES$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.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.jcajce.provider.symmetric.DES$KeyFactory.engineGetKeySpec() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey p6, Class p7)
    {
        if (p7 != null) {
            if (p6 != null) {
                java.security.spec.InvalidKeySpecException v2_3;
                if (!javax.crypto.spec.SecretKeySpec.isAssignableFrom(p7)) {
                    if (!javax.crypto.spec.DESKeySpec.isAssignableFrom(p7)) {
                        throw new java.security.spec.InvalidKeySpecException("Invalid KeySpec");
                    } else {
                        try {
                            v2_3 = new javax.crypto.spec.DESKeySpec(p6.getEncoded());
                        } catch (Exception v1) {
                            throw new java.security.spec.InvalidKeySpecException(v1.toString());
                        }
                    }
                } else {
                    v2_3 = new javax.crypto.spec.SecretKeySpec(p6.getEncoded(), this.algName);
                }
                return v2_3;
            } 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.jcajce.provider.symmetric.DES$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;
        }
        return new javax.crypto.spec.SecretKeySpec(this.engine.generateKey(), this.algName);
    }

Method org.spongycastle.jcajce.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.jcajce.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.jcajce.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.jcajce.provider.symmetric.util.BaseSecretKeyFactory$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.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;
    }

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.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$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.JDKKeyStore.decodeKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private java.security.Key decodeKey(java.io.DataInputStream p10)
    {
        java.io.IOException v6_13;
        java.security.spec.X509EncodedKeySpec v5_1;
        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.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.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.operator.jcajce.JceAsymmetricKeyUnwrapper.generateUnwrappedKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public org.spongycastle.operator.GenericKey generateUnwrappedKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9)
    {
        try {
            javax.crypto.Cipher v1 = this.helper.createAsymmetricWrapper(this.getAlgorithmIdentifier().getAlgorithm(), this.extraMappings);
            try {
                v1.init(4, this.privKey);
                java.security.Key v2_0 = v1.unwrap(p9, this.helper.getKeyAlgorithmName(p8.getAlgorithm()), 3);
                java.security.Key v3 = v2_0;
            } catch (org.spongycastle.operator.GenericKey v4) {
                v3 = v2_0;
            } catch (org.spongycastle.operator.GenericKey v4) {
                v3 = v2_0;
            } catch (org.spongycastle.operator.GenericKey v4) {
                v3 = v2_0;
            } catch (org.spongycastle.operator.GenericKey v4) {
                v3 = v2_0;
            }
            java.security.Key v2_1;
            if (v3 != null) {
                v2_1 = v3;
            } else {
                try {
                    v1.init(2, this.privKey);
                    v2_1 = new javax.crypto.spec.SecretKeySpec(v1.doFinal(p9), p8.getAlgorithm().getId());
                } catch (javax.crypto.BadPaddingException v0_2) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("key invalid: ").append(v0_2.getMessage()).toString(), v0_2);
                } catch (javax.crypto.BadPaddingException v0_1) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("illegal blocksize: ").append(v0_1.getMessage()).toString(), v0_1);
                } catch (javax.crypto.BadPaddingException v0_0) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("bad padding: ").append(v0_0.getMessage()).toString(), v0_0);
                }
            }
            return new org.spongycastle.operator.GenericKey(v2_1);
        } catch (javax.crypto.BadPaddingException v0_2) {
        } catch (javax.crypto.BadPaddingException v0_1) {
        } catch (javax.crypto.BadPaddingException v0_0) {
        }
    }

Method org.spongycastle.operator.jcajce.OperatorUtils.getJceKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    static java.security.Key getJceKey(org.spongycastle.operator.GenericKey p3)
    {
        IllegalArgumentException v0_5;
        if (!(p3.getRepresentation() instanceof java.security.Key)) {
            if (!(p3.getRepresentation() instanceof byte[])) {
                throw new IllegalArgumentException("unknown generic key type");
            } else {
                v0_5 = new javax.crypto.spec.SecretKeySpec(((byte[]) ((byte[]) p3.getRepresentation())), "ENC");
            }
        } else {
            v0_5 = ((java.security.Key) p3.getRepresentation());
        }
        return v0_5;
    }

Method domain.authentication.helper.Encrypter.encryptUsingPublicKey() calling method javax.crypto.Cipher.doFinal()


    public byte[] encryptUsingPublicKey(byte[] p5)
    {
        this.setPublicKey();
        javax.crypto.Cipher v1 = javax.crypto.Cipher.getInstance("RSA/ECB/PKCS1Padding", "BC");
        v1.init(1, domain.authentication.helper.Encrypter.publicKey);
        return v1.doFinal(p5);
    }

Method org.apache.xml.security.encryption.XMLCipher.decryptToByteArray() calling method javax.crypto.Cipher.doFinal()


    public byte[] decryptToByteArray(org.w3c.dom.Element p7)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Decrypting to ByteArray...");
        if (this._cipherMode != 2) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("XMLCipher unexpectedly not in DECRYPT_MODE...");
        }
        javax.crypto.BadPaddingException v0_4 = this._factory.newEncryptedData(p7);
        if (this._key == null) {
            org.apache.xml.security.encryption.XMLEncryptionException v1_2 = v0_4.getKeyInfo();
            if (v1_2 != null) {
                try {
                    v1_2.registerInternalKeyResolver(new org.apache.xml.security.keys.keyresolver.implementations.EncryptedKeyResolver(v0_4.getEncryptionMethod().getAlgorithm(), this._kek));
                    this._key = v1_2.getSecretKey();
                } catch (org.apache.xml.security.encryption.XMLEncryptionException v1) {
                }
            }
            if (this._key == null) {
                org.apache.xml.security.encryption.XMLCipher.logger.error("XMLCipher::decryptElement called without a key and unable to resolve");
                throw new org.apache.xml.security.encryption.XMLEncryptionException("encryption.nokey");
            }
        }
        org.apache.xml.security.encryption.XMLEncryptionException v1_8 = new org.apache.xml.security.encryption.XMLCipherInput(v0_4).getBytes();
        javax.crypto.BadPaddingException v0_8 = org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(v0_4.getEncryptionMethod().getAlgorithm());
        try {
            javax.crypto.BadPaddingException v0_9;
            if (this._requestedJCEProvider != null) {
                v0_9 = javax.crypto.Cipher.getInstance(v0_8, this._requestedJCEProvider);
            } else {
                v0_9 = javax.crypto.Cipher.getInstance(v0_8);
            }
        } catch (javax.crypto.BadPaddingException v0_12) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_12);
        } catch (javax.crypto.BadPaddingException v0_11) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_11);
        } catch (javax.crypto.BadPaddingException v0_10) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_10);
        }
        String v2_7 = v0_9.getBlockSize();
        int v3_2 = new byte[v2_7];
        System.arraycopy(v1_8, 0, v3_2, 0, v2_7);
        try {
            v0_9.init(this._cipherMode, this._key, new javax.crypto.spec.IvParameterSpec(v3_2));
            try {
                return v0_9.doFinal(v1_8, v2_7, (v1_8.length - v2_7));
            } catch (javax.crypto.BadPaddingException v0_18) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_18);
            } catch (javax.crypto.BadPaddingException v0_17) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_17);
            }
        } catch (javax.crypto.BadPaddingException v0_15) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_15);
        } catch (javax.crypto.BadPaddingException v0_14) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_14);
        }
        return v0_9.doFinal(v1_8, v2_7, (v1_8.length - v2_7));
    }

Method org.apache.xml.security.encryption.XMLCipher.encryptData() calling method javax.crypto.Cipher.doFinal()


    public org.apache.xml.security.encryption.EncryptedData encryptData(org.w3c.dom.Document p8, org.w3c.dom.Element p9, boolean p10)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Encrypting element...");
        if (p8 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Context document unexpectedly null...");
        }
        if (p9 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Element unexpectedly null...");
        }
        if (this._cipherMode != 1) {
            org.apache.xml.security.encryption.XMLCipher.logger.debug("XMLCipher unexpectedly not in ENCRYPT_MODE...");
        }
        this._contextDocument = p8;
        if (this._algorithm != null) {
            org.apache.xml.security.encryption.EncryptedData v0_28;
            if (!p10) {
                v0_28 = this._serializer.serialize(p9);
            } else {
                org.apache.xml.security.encryption.EncryptedData v0_29 = p9.getChildNodes();
                if (v0_29 == null) {
                    org.apache.xml.security.encryption.EncryptedData v0_30 = new Object[1];
                    v0_30[0] = "Element has no content.";
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_30);
                } else {
                    v0_28 = this._serializer.serialize(v0_29);
                }
            }
            org.apache.xml.security.encryption.EncryptedData v1_38;
            org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Serialized octets:\n").append(v0_28).toString());
            if (this._contextCipher != null) {
                v1_38 = this._contextCipher;
            } else {
                org.apache.xml.security.encryption.EncryptedData v1_40 = org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(this._algorithm);
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("alg = ").append(v1_40).toString());
                try {
                    if (this._requestedJCEProvider != null) {
                        v1_38 = javax.crypto.Cipher.getInstance(v1_40, this._requestedJCEProvider);
                    } else {
                        v1_38 = javax.crypto.Cipher.getInstance(v1_40);
                    }
                } catch (org.apache.xml.security.encryption.EncryptedData v0_34) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_34);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_33) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_33);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_32) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_32);
                }
                v1_38.init(this._cipherMode, this._key);
                try {
                    String v2_1 = v1_38.doFinal(v0_28.getBytes("UTF-8"));
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Expected cipher.outputSize = ").append(Integer.toString(v1_38.getOutputSize(v0_28.getBytes().length))).toString());
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Actual cipher.outputSize = ").append(Integer.toString(v2_1.length)).toString());
                    org.apache.xml.security.encryption.EncryptedData v0_9 = v1_38.getIV();
                    org.apache.xml.security.encryption.EncryptedData v1_3 = new byte[(v0_9.length + v2_1.length)];
                    System.arraycopy(v0_9, 0, v1_3, 0, v0_9.length);
                    System.arraycopy(v2_1, 0, v1_3, v0_9.length, v2_1.length);
                    org.apache.xml.security.encryption.EncryptedData v0_11 = org.apache.xml.security.utils.Base64.encode(v1_3);
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Encrypted octets:\n").append(v0_11).toString());
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Encrypted octets length = ").append(v0_11.length()).toString());
                    try {
                        this._ed.getCipherData().getCipherValue().setValue(v0_11);
                    } catch (org.apache.xml.security.encryption.EncryptedData v0_21) {
                        throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_21);
                    }
                    if (!p10) {
                        this._ed.setType(new org.apache.xml.utils.URI("http://www.w3.org/2001/04/xmlenc#Element").toString());
                    } else {
                        this._ed.setType(new org.apache.xml.utils.URI("http://www.w3.org/2001/04/xmlenc#Content").toString());
                    }
                    this._ed.setEncryptionMethod(this._factory.newEncryptionMethod(new org.apache.xml.utils.URI(this._algorithm).toString()));
                    return this._ed;
                } catch (org.apache.xml.security.encryption.EncryptedData v0_16) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_16);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_15) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_15);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_14) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_14);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_13) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_13);
                }
            }
            try {
            } catch (org.apache.xml.security.encryption.EncryptedData v0_35) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_35);
            }
        } else {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("XMLCipher instance without transformation specified");
        }
    }

Method org.spongycastle.cert.crmf.jcajce.JceAsymmetricValueDecryptorGenerator.extractSecretKey() calling method javax.crypto.Cipher.doFinal()


    private java.security.Key extractSecretKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p7, org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9)
    {
        try {
            javax.crypto.Cipher v1 = this.helper.createCipher(p7.getAlgorithm());
            try {
                v1.init(4, this.recipientKey);
                java.security.Key v2_0 = v1.unwrap(p9, p8.getAlgorithm().getId(), 3);
                java.security.Key v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            }
            java.security.Key v2_1;
            if (v3 != null) {
                v2_1 = v3;
            } else {
                try {
                    v1.init(2, this.recipientKey);
                    v2_1 = new javax.crypto.spec.SecretKeySpec(v1.doFinal(p9), p8.getAlgorithm().getId());
                } catch (javax.crypto.BadPaddingException v0_2) {
                    throw new org.spongycastle.cert.crmf.CRMFException("key invalid in message.", v0_2);
                } catch (javax.crypto.BadPaddingException v0_1) {
                    throw new org.spongycastle.cert.crmf.CRMFException("illegal blocksize in message.", v0_1);
                } catch (javax.crypto.BadPaddingException v0_0) {
                    throw new org.spongycastle.cert.crmf.CRMFException("bad padding in message.", v0_0);
                }
            }
            return v2_1;
        } catch (javax.crypto.BadPaddingException v0_2) {
        } catch (javax.crypto.BadPaddingException v0_1) {
        } catch (javax.crypto.BadPaddingException v0_0) {
        }
    }

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.getAlgorithm().getId();
        org.spongycastle.asn1.pkcs.PKCS12PBEParams v8 = org.spongycastle.asn1.pkcs.PKCS12PBEParams.getInstance(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.getIV(), v8.getIterations().intValue());
            org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey v5_1 = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.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.ASN1Primitive.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.ASN1Primitive.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.ASN1Primitive.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().toASN1Primitive().getEncoded());
                v5_1.init(2, v11, v3);
                org.spongycastle.asn1.pkcs.PrivateKeyInfo v14_2 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Primitive.fromByteArray(v5_1.doFinal(v9.getEncryptedData())));
                v20_6 = java.security.KeyFactory.getInstance(v14_2.getPrivateKeyAlgorithm().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.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";
        }
        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.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.ASN1ObjectIdentifier v1_0 = new org.spongycastle.asn1.ASN1ObjectIdentifier(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.ASN1Integer(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, org.spongycastle.asn1.pkcs.PKCS12PBEParams.getInstance(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.ASN1ObjectIdentifier(this.algorithm), org.spongycastle.asn1.ASN1Primitive.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.operator.jcajce.JceAsymmetricKeyUnwrapper.generateUnwrappedKey() calling method javax.crypto.Cipher.doFinal()


    public org.spongycastle.operator.GenericKey generateUnwrappedKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9)
    {
        try {
            javax.crypto.Cipher v1 = this.helper.createAsymmetricWrapper(this.getAlgorithmIdentifier().getAlgorithm(), this.extraMappings);
            try {
                v1.init(4, this.privKey);
                java.security.Key v2_0 = v1.unwrap(p9, this.helper.getKeyAlgorithmName(p8.getAlgorithm()), 3);
                java.security.Key v3 = v2_0;
            } catch (org.spongycastle.operator.GenericKey v4) {
                v3 = v2_0;
            } catch (org.spongycastle.operator.GenericKey v4) {
                v3 = v2_0;
            } catch (org.spongycastle.operator.GenericKey v4) {
                v3 = v2_0;
            } catch (org.spongycastle.operator.GenericKey v4) {
                v3 = v2_0;
            }
            java.security.Key v2_1;
            if (v3 != null) {
                v2_1 = v3;
            } else {
                try {
                    v1.init(2, this.privKey);
                    v2_1 = new javax.crypto.spec.SecretKeySpec(v1.doFinal(p9), p8.getAlgorithm().getId());
                } catch (javax.crypto.BadPaddingException v0_2) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("key invalid: ").append(v0_2.getMessage()).toString(), v0_2);
                } catch (javax.crypto.BadPaddingException v0_1) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("illegal blocksize: ").append(v0_1.getMessage()).toString(), v0_1);
                } catch (javax.crypto.BadPaddingException v0_0) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("bad padding: ").append(v0_0.getMessage()).toString(), v0_0);
                }
            }
            return new org.spongycastle.operator.GenericKey(v2_1);
        } catch (javax.crypto.BadPaddingException v0_2) {
        } catch (javax.crypto.BadPaddingException v0_1) {
        } catch (javax.crypto.BadPaddingException v0_0) {
        }
    }

Method org.spongycastle.operator.jcajce.JceAsymmetricKeyWrapper.generateWrappedKey() calling method javax.crypto.Cipher.doFinal()


    public byte[] generateWrappedKey(org.spongycastle.operator.GenericKey p7)
    {
        javax.crypto.Cipher v2 = this.helper.createAsymmetricWrapper(this.getAlgorithmIdentifier().getAlgorithm(), this.extraMappings);
        try {
            v2.init(3, this.publicKey, this.random);
            byte[] v1 = v2.wrap(org.spongycastle.operator.jcajce.OperatorUtils.getJceKey(p7));
        } catch (org.spongycastle.operator.OperatorException v3) {
        } catch (org.spongycastle.operator.OperatorException v3) {
        } catch (org.spongycastle.operator.OperatorException v3) {
        } catch (org.spongycastle.operator.OperatorException v3) {
        }
        if (v1 == null) {
            try {
                v2.init(1, this.publicKey, this.random);
                v1 = v2.doFinal(org.spongycastle.operator.jcajce.OperatorUtils.getJceKey(p7).getEncoded());
            } catch (java.security.GeneralSecurityException v0) {
                throw new org.spongycastle.operator.OperatorException("unable to encrypt contents key", v0);
            }
        }
        return v1;
    }

Method org.apache.xml.security.encryption.XMLCipher.encryptData() calling method javax.crypto.Cipher.getIV()


    public org.apache.xml.security.encryption.EncryptedData encryptData(org.w3c.dom.Document p8, org.w3c.dom.Element p9, boolean p10)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Encrypting element...");
        if (p8 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Context document unexpectedly null...");
        }
        if (p9 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Element unexpectedly null...");
        }
        if (this._cipherMode != 1) {
            org.apache.xml.security.encryption.XMLCipher.logger.debug("XMLCipher unexpectedly not in ENCRYPT_MODE...");
        }
        this._contextDocument = p8;
        if (this._algorithm != null) {
            org.apache.xml.security.encryption.EncryptedData v0_28;
            if (!p10) {
                v0_28 = this._serializer.serialize(p9);
            } else {
                org.apache.xml.security.encryption.EncryptedData v0_29 = p9.getChildNodes();
                if (v0_29 == null) {
                    org.apache.xml.security.encryption.EncryptedData v0_30 = new Object[1];
                    v0_30[0] = "Element has no content.";
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_30);
                } else {
                    v0_28 = this._serializer.serialize(v0_29);
                }
            }
            org.apache.xml.security.encryption.EncryptedData v1_38;
            org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Serialized octets:\n").append(v0_28).toString());
            if (this._contextCipher != null) {
                v1_38 = this._contextCipher;
            } else {
                org.apache.xml.security.encryption.EncryptedData v1_40 = org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(this._algorithm);
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("alg = ").append(v1_40).toString());
                try {
                    if (this._requestedJCEProvider != null) {
                        v1_38 = javax.crypto.Cipher.getInstance(v1_40, this._requestedJCEProvider);
                    } else {
                        v1_38 = javax.crypto.Cipher.getInstance(v1_40);
                    }
                } catch (org.apache.xml.security.encryption.EncryptedData v0_34) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_34);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_33) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_33);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_32) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_32);
                }
                v1_38.init(this._cipherMode, this._key);
                try {
                    String v2_1 = v1_38.doFinal(v0_28.getBytes("UTF-8"));
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Expected cipher.outputSize = ").append(Integer.toString(v1_38.getOutputSize(v0_28.getBytes().length))).toString());
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Actual cipher.outputSize = ").append(Integer.toString(v2_1.length)).toString());
                    org.apache.xml.security.encryption.EncryptedData v0_9 = v1_38.getIV();
                    org.apache.xml.security.encryption.EncryptedData v1_3 = new byte[(v0_9.length + v2_1.length)];
                    System.arraycopy(v0_9, 0, v1_3, 0, v0_9.length);
                    System.arraycopy(v2_1, 0, v1_3, v0_9.length, v2_1.length);
                    org.apache.xml.security.encryption.EncryptedData v0_11 = org.apache.xml.security.utils.Base64.encode(v1_3);
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Encrypted octets:\n").append(v0_11).toString());
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Encrypted octets length = ").append(v0_11.length()).toString());
                    try {
                        this._ed.getCipherData().getCipherValue().setValue(v0_11);
                    } catch (org.apache.xml.security.encryption.EncryptedData v0_21) {
                        throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_21);
                    }
                    if (!p10) {
                        this._ed.setType(new org.apache.xml.utils.URI("http://www.w3.org/2001/04/xmlenc#Element").toString());
                    } else {
                        this._ed.setType(new org.apache.xml.utils.URI("http://www.w3.org/2001/04/xmlenc#Content").toString());
                    }
                    this._ed.setEncryptionMethod(this._factory.newEncryptionMethod(new org.apache.xml.utils.URI(this._algorithm).toString()));
                    return this._ed;
                } catch (org.apache.xml.security.encryption.EncryptedData v0_16) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_16);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_15) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_15);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_14) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_14);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_13) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_13);
                }
            }
            try {
            } catch (org.apache.xml.security.encryption.EncryptedData v0_35) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_35);
            }
        } else {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("XMLCipher instance without transformation specified");
        }
    }

Method domain.authentication.helper.Encrypter.encryptUsingPublicKey() calling method javax.crypto.Cipher.getInstance()


    public byte[] encryptUsingPublicKey(byte[] p5)
    {
        this.setPublicKey();
        javax.crypto.Cipher v1 = javax.crypto.Cipher.getInstance("RSA/ECB/PKCS1Padding", "BC");
        v1.init(1, domain.authentication.helper.Encrypter.publicKey);
        return v1.doFinal(p5);
    }

Method org.apache.xml.security.encryption.XMLCipher.getInstance() calling method javax.crypto.Cipher.getInstance()


    public static org.apache.xml.security.encryption.XMLCipher getInstance(String p4)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Getting XMLCipher...");
        if (p4 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Transformation unexpectedly null...");
        }
        if (!org.apache.xml.security.encryption.XMLCipher.isValidEncryptionAlgorithm(p4)) {
            org.apache.xml.security.encryption.XMLCipher.logger.warn("Algorithm non-standard, expected one of http://www.w3.org/2001/04/xmlenc#tripledes-cbc\nhttp://www.w3.org/2001/04/xmlenc#aes128-cbc\nhttp://www.w3.org/2001/04/xmlenc#aes256-cbc\nhttp://www.w3.org/2001/04/xmlenc#aes192-cbc\nhttp://www.w3.org/2001/04/xmlenc#rsa-1_5\nhttp://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p\nhttp://www.w3.org/2001/04/xmlenc#kw-tripledes\nhttp://www.w3.org/2001/04/xmlenc#kw-aes128\nhttp://www.w3.org/2001/04/xmlenc#kw-aes256\nhttp://www.w3.org/2001/04/xmlenc#kw-aes192\n");
        }
        javax.crypto.NoSuchPaddingException v0_3 = new org.apache.xml.security.encryption.XMLCipher();
        v0_3._algorithm = p4;
        v0_3._key = 0;
        v0_3._kek = 0;
        try {
            v0_3._canon = org.apache.xml.security.c14n.Canonicalizer.getInstance("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments");
            try {
                v0_3._contextCipher = javax.crypto.Cipher.getInstance(org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(p4));
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("cihper.algoritm = ").append(v0_3._contextCipher.getAlgorithm()).toString());
                return v0_3;
            } catch (javax.crypto.NoSuchPaddingException v0_7) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_7);
            } catch (javax.crypto.NoSuchPaddingException v0_5) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_5);
            }
        } catch (javax.crypto.NoSuchPaddingException v0_4) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_4);
        }
        v0_3._contextCipher = javax.crypto.Cipher.getInstance(org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(p4));
        org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("cihper.algoritm = ").append(v0_3._contextCipher.getAlgorithm()).toString());
        return v0_3;
    }

Method org.apache.xml.security.encryption.XMLCipher.getProviderInstance() calling method javax.crypto.Cipher.getInstance()


    public static org.apache.xml.security.encryption.XMLCipher getProviderInstance(String p4, String p5)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Getting XMLCipher...");
        if (p4 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Transformation unexpectedly null...");
        }
        if (p5 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Provider unexpectedly null..");
        }
        if ("" == p5) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Provider\'s value unexpectedly not specified...");
        }
        if (!org.apache.xml.security.encryption.XMLCipher.isValidEncryptionAlgorithm(p4)) {
            org.apache.xml.security.encryption.XMLCipher.logger.warn("Algorithm non-standard, expected one of http://www.w3.org/2001/04/xmlenc#tripledes-cbc\nhttp://www.w3.org/2001/04/xmlenc#aes128-cbc\nhttp://www.w3.org/2001/04/xmlenc#aes256-cbc\nhttp://www.w3.org/2001/04/xmlenc#aes192-cbc\nhttp://www.w3.org/2001/04/xmlenc#rsa-1_5\nhttp://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p\nhttp://www.w3.org/2001/04/xmlenc#kw-tripledes\nhttp://www.w3.org/2001/04/xmlenc#kw-aes128\nhttp://www.w3.org/2001/04/xmlenc#kw-aes256\nhttp://www.w3.org/2001/04/xmlenc#kw-aes192\n");
        }
        javax.crypto.NoSuchPaddingException v0_6 = new org.apache.xml.security.encryption.XMLCipher();
        v0_6._algorithm = p4;
        v0_6._requestedJCEProvider = p5;
        v0_6._key = 0;
        v0_6._kek = 0;
        try {
            v0_6._canon = org.apache.xml.security.c14n.Canonicalizer.getInstance("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments");
            try {
                v0_6._contextCipher = javax.crypto.Cipher.getInstance(org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(p4), p5);
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("cipher._algorithm = ").append(v0_6._contextCipher.getAlgorithm()).toString());
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("provider.name = ").append(p5).toString());
                return v0_6;
            } catch (javax.crypto.NoSuchPaddingException v0_11) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_11);
            } catch (javax.crypto.NoSuchPaddingException v0_10) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_10);
            } catch (javax.crypto.NoSuchPaddingException v0_9) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_9);
            }
        } catch (javax.crypto.NoSuchPaddingException v0_7) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_7);
        }
        v0_6._contextCipher = javax.crypto.Cipher.getInstance(org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(p4), p5);
        org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("cipher._algorithm = ").append(v0_6._contextCipher.getAlgorithm()).toString());
        org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("provider.name = ").append(p5).toString());
        return v0_6;
    }

Method org.apache.xml.security.encryption.XMLCipher.decryptKey() calling method javax.crypto.Cipher.getInstance()


    public java.security.Key decryptKey(org.apache.xml.security.encryption.EncryptedKey p7, String p8)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Decrypting key from previously loaded EncryptedKey...");
        if (this._cipherMode != 4) {
            org.apache.xml.security.encryption.XMLCipher.logger.debug("XMLCipher unexpectedly not in UNWRAP_MODE...");
        }
        if (p8 != null) {
            if (this._key == null) {
                org.apache.xml.security.encryption.XMLCipher.logger.debug("Trying to find a KEK via key resolvers");
                java.security.NoSuchAlgorithmException v0_8 = p7.getKeyInfo();
                if (v0_8 != null) {
                    try {
                        this._key = v0_8.getSecretKey();
                    } catch (java.security.NoSuchAlgorithmException v0) {
                    }
                }
                if (this._key == null) {
                    org.apache.xml.security.encryption.XMLCipher.logger.error("XMLCipher::decryptKey called without a KEK and cannot resolve");
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("Unable to decrypt without a KEK");
                }
            }
            java.security.NoSuchAlgorithmException v0_14;
            org.apache.xml.security.encryption.XMLEncryptionException v1_6 = new org.apache.xml.security.encryption.XMLCipherInput(p7).getBytes();
            String v2_2 = org.apache.xml.security.algorithms.JCEMapper.getJCEKeyAlgorithmFromURI(p8);
            if (this._contextCipher != null) {
                v0_14 = this._contextCipher;
            } else {
                java.security.NoSuchAlgorithmException v0_17 = org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(p7.getEncryptionMethod().getAlgorithm());
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("JCE Algorithm = ").append(v0_17).toString());
                try {
                    if (this._requestedJCEProvider != null) {
                        v0_14 = javax.crypto.Cipher.getInstance(v0_17, this._requestedJCEProvider);
                    } else {
                        v0_14 = javax.crypto.Cipher.getInstance(v0_17);
                    }
                } catch (java.security.NoSuchAlgorithmException v0_22) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_22);
                } catch (java.security.NoSuchAlgorithmException v0_21) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_21);
                } catch (java.security.NoSuchAlgorithmException v0_19) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_19);
                }
                v0_14.init(4, this._key);
                java.security.NoSuchAlgorithmException v0_23 = v0_14.unwrap(v1_6, v2_2, 3);
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Decryption of key type ").append(p8).append(" OK").toString());
                return v0_23;
            }
            try {
                v0_14.init(4, this._key);
                v0_23 = v0_14.unwrap(v1_6, v2_2, 3);
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Decryption of key type ").append(p8).append(" OK").toString());
                return v0_23;
            } catch (java.security.NoSuchAlgorithmException v0_25) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_25);
            } catch (java.security.NoSuchAlgorithmException v0_24) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_24);
            }
        } else {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("Cannot decrypt a key without knowing the algorithm");
        }
    }

Method org.apache.xml.security.encryption.XMLCipher.decryptToByteArray() calling method javax.crypto.Cipher.getInstance()


    public byte[] decryptToByteArray(org.w3c.dom.Element p7)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Decrypting to ByteArray...");
        if (this._cipherMode != 2) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("XMLCipher unexpectedly not in DECRYPT_MODE...");
        }
        javax.crypto.BadPaddingException v0_4 = this._factory.newEncryptedData(p7);
        if (this._key == null) {
            org.apache.xml.security.encryption.XMLEncryptionException v1_2 = v0_4.getKeyInfo();
            if (v1_2 != null) {
                try {
                    v1_2.registerInternalKeyResolver(new org.apache.xml.security.keys.keyresolver.implementations.EncryptedKeyResolver(v0_4.getEncryptionMethod().getAlgorithm(), this._kek));
                    this._key = v1_2.getSecretKey();
                } catch (org.apache.xml.security.encryption.XMLEncryptionException v1) {
                }
            }
            if (this._key == null) {
                org.apache.xml.security.encryption.XMLCipher.logger.error("XMLCipher::decryptElement called without a key and unable to resolve");
                throw new org.apache.xml.security.encryption.XMLEncryptionException("encryption.nokey");
            }
        }
        org.apache.xml.security.encryption.XMLEncryptionException v1_8 = new org.apache.xml.security.encryption.XMLCipherInput(v0_4).getBytes();
        javax.crypto.BadPaddingException v0_8 = org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(v0_4.getEncryptionMethod().getAlgorithm());
        try {
            javax.crypto.BadPaddingException v0_9;
            if (this._requestedJCEProvider != null) {
                v0_9 = javax.crypto.Cipher.getInstance(v0_8, this._requestedJCEProvider);
            } else {
                v0_9 = javax.crypto.Cipher.getInstance(v0_8);
            }
        } catch (javax.crypto.BadPaddingException v0_12) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_12);
        } catch (javax.crypto.BadPaddingException v0_11) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_11);
        } catch (javax.crypto.BadPaddingException v0_10) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_10);
        }
        String v2_7 = v0_9.getBlockSize();
        int v3_2 = new byte[v2_7];
        System.arraycopy(v1_8, 0, v3_2, 0, v2_7);
        try {
            v0_9.init(this._cipherMode, this._key, new javax.crypto.spec.IvParameterSpec(v3_2));
            try {
                return v0_9.doFinal(v1_8, v2_7, (v1_8.length - v2_7));
            } catch (javax.crypto.BadPaddingException v0_18) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_18);
            } catch (javax.crypto.BadPaddingException v0_17) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_17);
            }
        } catch (javax.crypto.BadPaddingException v0_15) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_15);
        } catch (javax.crypto.BadPaddingException v0_14) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_14);
        }
        return v0_9.doFinal(v1_8, v2_7, (v1_8.length - v2_7));
    }

Method org.apache.xml.security.encryption.XMLCipher.encryptData() calling method javax.crypto.Cipher.getInstance()


    public org.apache.xml.security.encryption.EncryptedData encryptData(org.w3c.dom.Document p8, org.w3c.dom.Element p9, boolean p10)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Encrypting element...");
        if (p8 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Context document unexpectedly null...");
        }
        if (p9 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Element unexpectedly null...");
        }
        if (this._cipherMode != 1) {
            org.apache.xml.security.encryption.XMLCipher.logger.debug("XMLCipher unexpectedly not in ENCRYPT_MODE...");
        }
        this._contextDocument = p8;
        if (this._algorithm != null) {
            org.apache.xml.security.encryption.EncryptedData v0_28;
            if (!p10) {
                v0_28 = this._serializer.serialize(p9);
            } else {
                org.apache.xml.security.encryption.EncryptedData v0_29 = p9.getChildNodes();
                if (v0_29 == null) {
                    org.apache.xml.security.encryption.EncryptedData v0_30 = new Object[1];
                    v0_30[0] = "Element has no content.";
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_30);
                } else {
                    v0_28 = this._serializer.serialize(v0_29);
                }
            }
            org.apache.xml.security.encryption.EncryptedData v1_38;
            org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Serialized octets:\n").append(v0_28).toString());
            if (this._contextCipher != null) {
                v1_38 = this._contextCipher;
            } else {
                org.apache.xml.security.encryption.EncryptedData v1_40 = org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(this._algorithm);
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("alg = ").append(v1_40).toString());
                try {
                    if (this._requestedJCEProvider != null) {
                        v1_38 = javax.crypto.Cipher.getInstance(v1_40, this._requestedJCEProvider);
                    } else {
                        v1_38 = javax.crypto.Cipher.getInstance(v1_40);
                    }
                } catch (org.apache.xml.security.encryption.EncryptedData v0_34) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_34);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_33) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_33);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_32) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_32);
                }
                v1_38.init(this._cipherMode, this._key);
                try {
                    String v2_1 = v1_38.doFinal(v0_28.getBytes("UTF-8"));
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Expected cipher.outputSize = ").append(Integer.toString(v1_38.getOutputSize(v0_28.getBytes().length))).toString());
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Actual cipher.outputSize = ").append(Integer.toString(v2_1.length)).toString());
                    org.apache.xml.security.encryption.EncryptedData v0_9 = v1_38.getIV();
                    org.apache.xml.security.encryption.EncryptedData v1_3 = new byte[(v0_9.length + v2_1.length)];
                    System.arraycopy(v0_9, 0, v1_3, 0, v0_9.length);
                    System.arraycopy(v2_1, 0, v1_3, v0_9.length, v2_1.length);
                    org.apache.xml.security.encryption.EncryptedData v0_11 = org.apache.xml.security.utils.Base64.encode(v1_3);
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Encrypted octets:\n").append(v0_11).toString());
                    org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Encrypted octets length = ").append(v0_11.length()).toString());
                    try {
                        this._ed.getCipherData().getCipherValue().setValue(v0_11);
                    } catch (org.apache.xml.security.encryption.EncryptedData v0_21) {
                        throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_21);
                    }
                    if (!p10) {
                        this._ed.setType(new org.apache.xml.utils.URI("http://www.w3.org/2001/04/xmlenc#Element").toString());
                    } else {
                        this._ed.setType(new org.apache.xml.utils.URI("http://www.w3.org/2001/04/xmlenc#Content").toString());
                    }
                    this._ed.setEncryptionMethod(this._factory.newEncryptionMethod(new org.apache.xml.utils.URI(this._algorithm).toString()));
                    return this._ed;
                } catch (org.apache.xml.security.encryption.EncryptedData v0_16) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_16);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_15) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_15);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_14) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_14);
                } catch (org.apache.xml.security.encryption.EncryptedData v0_13) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_13);
                }
            }
            try {
            } catch (org.apache.xml.security.encryption.EncryptedData v0_35) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_35);
            }
        } else {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("XMLCipher instance without transformation specified");
        }
    }

Method org.apache.xml.security.encryption.XMLCipher.encryptKey() calling method javax.crypto.Cipher.getInstance()


    public org.apache.xml.security.encryption.EncryptedKey encryptKey(org.w3c.dom.Document p5, java.security.Key p6)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Encrypting key ...");
        if (p6 == null) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("Key unexpectedly null...");
        }
        if (this._cipherMode != 3) {
            org.apache.xml.security.encryption.XMLCipher.logger.debug("XMLCipher unexpectedly not in WRAP_MODE...");
        }
        if (this._algorithm != null) {
            org.apache.xml.utils.URI$MalformedURIException v0_10;
            this._contextDocument = p5;
            if (this._contextCipher != null) {
                v0_10 = this._contextCipher;
            } else {
                org.apache.xml.utils.URI$MalformedURIException v0_12 = org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(this._algorithm);
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("alg = ").append(v0_12).toString());
                try {
                    if (this._requestedJCEProvider != null) {
                        v0_10 = javax.crypto.Cipher.getInstance(v0_12, this._requestedJCEProvider);
                    } else {
                        v0_10 = javax.crypto.Cipher.getInstance(v0_12);
                    }
                } catch (org.apache.xml.utils.URI$MalformedURIException v0_15) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_15);
                } catch (org.apache.xml.utils.URI$MalformedURIException v0_14) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_14);
                } catch (org.apache.xml.utils.URI$MalformedURIException v0_13) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_13);
                }
                v0_10.init(3, this._key);
                org.apache.xml.utils.URI$MalformedURIException v0_18 = org.apache.xml.security.utils.Base64.encode(v0_10.wrap(p6));
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Encrypted key octets:\n").append(v0_18).toString());
                org.apache.xml.security.encryption.XMLCipher.logger.debug(new StringBuffer().append("Encrypted key octets length = ").append(v0_18.length()).toString());
                this._ek.getCipherData().getCipherValue().setValue(v0_18);
                try {
                    this._ek.setEncryptionMethod(this._factory.newEncryptionMethod(new org.apache.xml.utils.URI(this._algorithm).toString()));
                    return this._ek;
                } catch (org.apache.xml.utils.URI$MalformedURIException v0_5) {
                    throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_5);
                }
            }
            try {
            } catch (org.apache.xml.utils.URI$MalformedURIException v0_21) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_21);
            } catch (org.apache.xml.utils.URI$MalformedURIException v0_20) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_20);
            }
            this._ek.setEncryptionMethod(this._factory.newEncryptionMethod(new org.apache.xml.utils.URI(this._algorithm).toString()));
            return this._ek;
        } else {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("XMLCipher instance without transformation specified");
        }
    }

Method org.spongycastle.jcajce.DefaultJcaJceHelper.createCipher() calling method javax.crypto.Cipher.getInstance()


    public javax.crypto.Cipher createCipher(String p2)
    {
        return javax.crypto.Cipher.getInstance(p2);
    }

Method org.spongycastle.jcajce.NamedJcaJceHelper.createCipher() calling method javax.crypto.Cipher.getInstance()


    public javax.crypto.Cipher createCipher(String p2)
    {
        return javax.crypto.Cipher.getInstance(p2, this.providerName);
    }

Method org.spongycastle.jcajce.ProviderJcaJceHelper.createCipher() calling method javax.crypto.Cipher.getInstance()


    public javax.crypto.Cipher createCipher(String p2)
    {
        return javax.crypto.Cipher.getInstance(p2, this.provider);
    }

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 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.getAlgorithm().getId();
        org.spongycastle.asn1.pkcs.PKCS12PBEParams v8 = org.spongycastle.asn1.pkcs.PKCS12PBEParams.getInstance(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.getIV(), v8.getIterations().intValue());
            org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey v5_1 = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.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.getAlgorithm().getId();
        org.spongycastle.asn1.pkcs.PKCS12PBEParams v8 = org.spongycastle.asn1.pkcs.PKCS12PBEParams.getInstance(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.getIV(), v8.getIterations().intValue());
            javax.crypto.SecretKey v5 = v6.generateSecret(v9_0);
            ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.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.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.ASN1Primitive.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.ASN1Primitive.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.ASN1Primitive.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().toASN1Primitive().getEncoded());
                v5_1.init(2, v11, v3);
                org.spongycastle.asn1.pkcs.PrivateKeyInfo v14_2 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(org.spongycastle.asn1.ASN1Primitive.fromByteArray(v5_1.doFinal(v9.getEncryptedData())));
                v20_6 = java.security.KeyFactory.getInstance(v14_2.getPrivateKeyAlgorithm().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.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";
        }
        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.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.ASN1ObjectIdentifier(p7))) {
            this.secKeyFact = javax.crypto.SecretKeyFactory.getInstance(p7, p8);
        } else {
            this.paramGen = java.security.AlgorithmParameterGenerator.getInstance(p7, p8);
        }
        return;
    }

Method domain.authentication.helper.Encrypter.generateSessionKey() calling method javax.crypto.KeyGenerator.generateKey()


    public byte[] generateSessionKey()
    {
        javax.crypto.KeyGenerator v1 = javax.crypto.KeyGenerator.getInstance("AES", "BC");
        v1.init(256);
        return v1.generateKey().getEncoded();
    }

Method org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder$CRMFOutputEncryptor.<init>() calling method javax.crypto.KeyGenerator.generateKey()


    JceCRMFEncryptorBuilder$CRMFOutputEncryptor(org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder p7, org.spongycastle.asn1.ASN1ObjectIdentifier p8, int p9, java.security.SecureRandom p10)
    {
        this.this$0 = p7;
        javax.crypto.KeyGenerator v1 = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$000(p7).createKeyGenerator(p8);
        if (p10 == null) {
            p10 = new java.security.SecureRandom();
        }
        if (p9 >= 0) {
            v1.init(p9, p10);
        } else {
            v1.init(p10);
        }
        this.cipher = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$000(p7).createCipher(p8);
        this.encKey = v1.generateKey();
        java.security.AlgorithmParameters v2 = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$000(p7).generateParameters(p8, this.encKey, p10);
        try {
            this.cipher.init(1, this.encKey, v2, p10);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cert.crmf.CRMFException(new StringBuilder().append("unable to initialize cipher: ").append(v0.getMessage()).toString(), v0);
        }
        if (v2 == null) {
            v2 = this.cipher.getParameters();
        }
        this.algorithmIdentifier = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$000(p7).getAlgorithmIdentifier(p8, v2);
        return;
    }

Method org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder$CMSOutputEncryptor.<init>() calling method javax.crypto.KeyGenerator.generateKey()


    JceCMSMacCalculatorBuilder$CMSOutputEncryptor(org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder p6, org.spongycastle.asn1.ASN1ObjectIdentifier p7, int p8, java.security.SecureRandom p9)
    {
        this.this$0 = p6;
        javax.crypto.KeyGenerator v0 = org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder.access$000(p6).createKeyGenerator(p7);
        if (p9 == null) {
            p9 = new java.security.SecureRandom();
        }
        this.random = p9;
        if (p8 >= 0) {
            v0.init(p8, p9);
        } else {
            v0.init(p9);
        }
        this.encKey = v0.generateKey();
        this.algorithmIdentifier = org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder.access$000(p6).getAlgorithmIdentifier(p7, this.generateParameterSpec(p7, this.encKey));
        this.mac = org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder.access$000(p6).createContentMac(this.encKey, this.algorithmIdentifier);
        return;
    }

Method domain.authentication.helper.Encrypter.generateSessionKey() calling method javax.crypto.KeyGenerator.getInstance()


    public byte[] generateSessionKey()
    {
        javax.crypto.KeyGenerator v1 = javax.crypto.KeyGenerator.getInstance("AES", "BC");
        v1.init(256);
        return v1.generateKey().getEncoded();
    }

Method org.spongycastle.cms.CMSEnvelopedHelper.createKeyGenerator() calling method javax.crypto.KeyGenerator.getInstance()


    private javax.crypto.KeyGenerator createKeyGenerator(String p2, java.security.Provider p3)
    {
        javax.crypto.KeyGenerator v0;
        if (p3 == null) {
            v0 = javax.crypto.KeyGenerator.getInstance(p2);
        } else {
            v0 = javax.crypto.KeyGenerator.getInstance(p2, p3);
        }
        return v0;
    }

Method org.spongycastle.jcajce.DefaultJcaJceHelper.createKeyGenerator() calling method javax.crypto.KeyGenerator.getInstance()


    public javax.crypto.KeyGenerator createKeyGenerator(String p2)
    {
        return javax.crypto.KeyGenerator.getInstance(p2);
    }

Method org.spongycastle.jcajce.NamedJcaJceHelper.createKeyGenerator() calling method javax.crypto.KeyGenerator.getInstance()


    public javax.crypto.KeyGenerator createKeyGenerator(String p2)
    {
        return javax.crypto.KeyGenerator.getInstance(p2, this.providerName);
    }

Method org.spongycastle.jcajce.ProviderJcaJceHelper.createKeyGenerator() calling method javax.crypto.KeyGenerator.getInstance()


    public javax.crypto.KeyGenerator createKeyGenerator(String p2)
    {
        return javax.crypto.KeyGenerator.getInstance(p2, this.provider);
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher.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.jcajce.provider.symmetric.util.BCPBEKey)) {
                    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_7 = v8_4;
                                                } else {
                                                    v7_7 = new org.spongycastle.crypto.params.ParametersWithRandom(v8_4, p18);
                                                }
                                                try {
                                                    switch (p15) {
                                                        case 1:
                                                        case 3:
                                                            this.cipher.init(1, v7_7);
                                                            return;
                                                        case 2:
                                                        case 4:
                                                            this.cipher.init(0, v7_7);
                                                            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))) {
                                    if (!(p16 instanceof org.spongycastle.jce.spec.RepeatedSecretKeySpec)) {
                                        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 {
                                        v7_1 = new org.spongycastle.crypto.params.ParametersWithIV(0, ((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.jcajce.provider.symmetric.util.BCPBEKey) p16).getOID() == null) {
                        this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getAlgorithm();
                    } else {
                        this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getOID().getId();
                    }
                    if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16), p17, this.cipher.getUnderlyingCipher().getAlgorithmName());
                        }
                    } else {
                        v7_1 = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getParam();
                        this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getSalt(), ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.jcajce.provider.symmetric.util.BaseStreamCipher.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.jcajce.provider.symmetric.util.BCPBEKey)) {
                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.jcajce.provider.symmetric.util.BCPBEKey) p11).getOID() == null) {
                    this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getAlgorithm();
                } else {
                    this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getOID().getId();
                }
                if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11), p12, this.cipher.getAlgorithmName());
                        this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p12);
                    }
                } else {
                    v3_1 = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getParam();
                    this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getSalt(), ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getIterationCount());
                }
                if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.jcajce.provider.symmetric.util.BCPBEKey)) {
                    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_7 = v8_4;
                                                } else {
                                                    v7_7 = new org.spongycastle.crypto.params.ParametersWithRandom(v8_4, p18);
                                                }
                                                try {
                                                    switch (p15) {
                                                        case 1:
                                                        case 3:
                                                            this.cipher.init(1, v7_7);
                                                            return;
                                                        case 2:
                                                        case 4:
                                                            this.cipher.init(0, v7_7);
                                                            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))) {
                                    if (!(p16 instanceof org.spongycastle.jce.spec.RepeatedSecretKeySpec)) {
                                        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 {
                                        v7_1 = new org.spongycastle.crypto.params.ParametersWithIV(0, ((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.jcajce.provider.symmetric.util.BCPBEKey) p16).getOID() == null) {
                        this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getAlgorithm();
                    } else {
                        this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getOID().getId();
                    }
                    if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16), p17, this.cipher.getUnderlyingCipher().getAlgorithmName());
                        }
                    } else {
                        v7_1 = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getParam();
                        this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getSalt(), ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.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.jcajce.provider.symmetric.util.BCPBEKey)) {
                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.jcajce.provider.symmetric.util.BCPBEKey) p11).getOID() == null) {
                    this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getAlgorithm();
                } else {
                    this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getOID().getId();
                }
                if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11), p12, this.cipher.getAlgorithmName());
                        this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p12);
                    }
                } else {
                    v3_1 = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getParam();
                    this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getSalt(), ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p11).getIterationCount());
                }
                if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) 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.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.apache.xml.security.encryption.XMLCipher.decryptToByteArray() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public byte[] decryptToByteArray(org.w3c.dom.Element p7)
    {
        org.apache.xml.security.encryption.XMLCipher.logger.debug("Decrypting to ByteArray...");
        if (this._cipherMode != 2) {
            org.apache.xml.security.encryption.XMLCipher.logger.error("XMLCipher unexpectedly not in DECRYPT_MODE...");
        }
        javax.crypto.BadPaddingException v0_4 = this._factory.newEncryptedData(p7);
        if (this._key == null) {
            org.apache.xml.security.encryption.XMLEncryptionException v1_2 = v0_4.getKeyInfo();
            if (v1_2 != null) {
                try {
                    v1_2.registerInternalKeyResolver(new org.apache.xml.security.keys.keyresolver.implementations.EncryptedKeyResolver(v0_4.getEncryptionMethod().getAlgorithm(), this._kek));
                    this._key = v1_2.getSecretKey();
                } catch (org.apache.xml.security.encryption.XMLEncryptionException v1) {
                }
            }
            if (this._key == null) {
                org.apache.xml.security.encryption.XMLCipher.logger.error("XMLCipher::decryptElement called without a key and unable to resolve");
                throw new org.apache.xml.security.encryption.XMLEncryptionException("encryption.nokey");
            }
        }
        org.apache.xml.security.encryption.XMLEncryptionException v1_8 = new org.apache.xml.security.encryption.XMLCipherInput(v0_4).getBytes();
        javax.crypto.BadPaddingException v0_8 = org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(v0_4.getEncryptionMethod().getAlgorithm());
        try {
            javax.crypto.BadPaddingException v0_9;
            if (this._requestedJCEProvider != null) {
                v0_9 = javax.crypto.Cipher.getInstance(v0_8, this._requestedJCEProvider);
            } else {
                v0_9 = javax.crypto.Cipher.getInstance(v0_8);
            }
        } catch (javax.crypto.BadPaddingException v0_12) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_12);
        } catch (javax.crypto.BadPaddingException v0_11) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_11);
        } catch (javax.crypto.BadPaddingException v0_10) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_10);
        }
        String v2_7 = v0_9.getBlockSize();
        int v3_2 = new byte[v2_7];
        System.arraycopy(v1_8, 0, v3_2, 0, v2_7);
        try {
            v0_9.init(this._cipherMode, this._key, new javax.crypto.spec.IvParameterSpec(v3_2));
            try {
                return v0_9.doFinal(v1_8, v2_7, (v1_8.length - v2_7));
            } catch (javax.crypto.BadPaddingException v0_18) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_18);
            } catch (javax.crypto.BadPaddingException v0_17) {
                throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_17);
            }
        } catch (javax.crypto.BadPaddingException v0_15) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_15);
        } catch (javax.crypto.BadPaddingException v0_14) {
            throw new org.apache.xml.security.encryption.XMLEncryptionException("empty", v0_14);
        }
        return v0_9.doFinal(v1_8, v2_7, (v1_8.length - v2_7));
    }

Method org.spongycastle.cert.crmf.jcajce.CRMFHelper$1.doInJCE() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public Object doInJCE()
    {
        javax.crypto.Cipher v0 = this.this$0.createCipher(this.val$encryptionAlgID.getAlgorithm());
        org.spongycastle.asn1.ASN1Primitive v4_0 = ((org.spongycastle.asn1.ASN1Primitive) this.val$encryptionAlgID.getParameters());
        String v2 = this.val$encryptionAlgID.getAlgorithm().getId();
        try {
            if ((v4_0 == null) || ((v4_0 instanceof org.spongycastle.asn1.ASN1Null))) {
                if ((!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.DES_EDE3_CBC)) && ((!v2.equals("1.3.6.1.4.1.188.7.1.1.2")) && (!v2.equals("1.2.840.113533.7.66.10")))) {
                    v0.init(2, this.val$sKey);
                } else {
                    byte[] v7_1 = new byte[8];
                    v0.init(2, this.val$sKey, new javax.crypto.spec.IvParameterSpec(v7_1));
                }
            } else {
                java.security.AlgorithmParameters v3 = this.this$0.createAlgorithmParameters(this.val$encryptionAlgID.getAlgorithm());
                v3.init(v4_0.getEncoded(), "ASN.1");
                v0.init(2, this.val$sKey, v3);
            }
        } catch (java.io.IOException v1_1) {
            if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.DES_EDE3_CBC)) {
                if (!v2.equals("1.3.6.1.4.1.188.7.1.1.2")) {
                    if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES128_CBC)) {
                        if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES192_CBC)) {
                            if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES256_CBC)) {
                                throw v1_1;
                            }
                        }
                    }
                }
            }
            v0.init(2, this.val$sKey, new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(v4_0).getOctets()));
        }
        return v0;
    }

Method org.spongycastle.cms.jcajce.EnvelopedDataHelper$1.doInJCE() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public Object doInJCE()
    {
        javax.crypto.Cipher v0 = this.this$0.createCipher(this.val$encryptionAlgID.getAlgorithm());
        org.spongycastle.asn1.ASN1Encodable v4 = this.val$encryptionAlgID.getParameters();
        String v2 = this.val$encryptionAlgID.getAlgorithm().getId();
        try {
            if ((v4 == null) || ((v4 instanceof org.spongycastle.asn1.ASN1Null))) {
                if ((!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.DES_EDE3_CBC)) && ((!v2.equals("1.3.6.1.4.1.188.7.1.1.2")) && (!v2.equals("1.2.840.113533.7.66.10")))) {
                    v0.init(2, this.val$sKey);
                } else {
                    byte[] v7_1 = new byte[8];
                    v0.init(2, this.val$sKey, new javax.crypto.spec.IvParameterSpec(v7_1));
                }
            } else {
                java.security.AlgorithmParameters v3 = this.this$0.createAlgorithmParameters(this.val$encryptionAlgID.getAlgorithm());
                v3.init(v4.toASN1Primitive().getEncoded(), "ASN.1");
                v0.init(2, this.val$sKey, v3);
            }
        } catch (java.io.IOException v1_1) {
            if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.DES_EDE3_CBC)) {
                if (!v2.equals("1.3.6.1.4.1.188.7.1.1.2")) {
                    if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES128_CBC)) {
                        if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES192_CBC)) {
                            if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES256_CBC)) {
                                throw v1_1;
                            }
                        }
                    }
                }
            }
            v0.init(2, this.val$sKey, new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(v4).getOctets()));
        }
        return v0;
    }

Method org.spongycastle.cms.jcajce.JcePasswordRecipient.extractSecretKey() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.Key extractSecretKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p7, org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9, byte[] p10)
    {
        javax.crypto.Cipher v2 = this.helper.createRFC3211Wrapper(p7.getAlgorithm());
        try {
            v2.init(4, new javax.crypto.spec.SecretKeySpec(p9, v2.getAlgorithm()), new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(p7.getParameters()).getOctets()));
            return v2.unwrap(p10, p8.getAlgorithm().getId(), 3);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("cannot process content encryption key: ").append(v0.getMessage()).toString(), v0);
        }
    }

Method org.spongycastle.cms.jcajce.JcePasswordRecipientInfoGenerator.generateEncryptedBytes() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public byte[] generateEncryptedBytes(org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9, org.spongycastle.operator.GenericKey p10)
    {
        java.security.Key v0 = this.helper.getJceKey(p10);
        javax.crypto.Cipher v3 = this.helper.createRFC3211Wrapper(p8.getAlgorithm());
        try {
            v3.init(3, new javax.crypto.spec.SecretKeySpec(p9, v3.getAlgorithm()), new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(p8.getParameters()).getOctets()));
            return v3.wrap(v0);
        } catch (java.security.GeneralSecurityException v1) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("cannot process content encryption key: ").append(v1.getMessage()).toString(), v1);
        }
    }

Method org.spongycastle.jcajce.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.jcajce.provider.symmetric.util.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.jcajce.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.jcajce.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.jcajce.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.jcajce.provider.symmetric.DES$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("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.jcajce.provider.symmetric.DESede$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("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.jcajce.provider.symmetric.GOST28147$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("GOST28147", 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.jcajce.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.jcajce.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.jcajce.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.jcajce.provider.symmetric.RC2$AlgParamGen.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.jcajce.provider.symmetric.RC2$AlgParams.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.jcajce.provider.symmetric.RC2$AlgParams.ekb[this.parameterVersion], this.iv);
            }
        }
        return v0_2;
    }

Method org.spongycastle.jcajce.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.jcajce.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.jcajce.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.jcajce.provider.symmetric.util.BaseAlgorithmParameters$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.jcajce.provider.symmetric.util.BaseAlgorithmParameters$RC2AlgorithmParameters.ekb[this.parameterVersion], this.iv);
            }
        }
        return v0_2;
    }

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";
        }
        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);
    }