Index: modules/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java =================================================================== --- modules/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java (revision 420501) +++ modules/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java (working copy) @@ -110,6 +110,9 @@ throw new NullPointerException("the algName parameter is null"); } this.algName = encrAlgName; + if (!mapAlgName()) { + throw new NoSuchAlgorithmException(this.algName + " not supported"); + } if (encryptedData == null) { throw new NullPointerException( "the encryptedData parameter is null"); @@ -121,9 +124,6 @@ System.arraycopy(encryptedData, 0, this.encryptedData, 0, encryptedData.length); this.algParameters = null; - if (!mapAlgName()) { - throw new NoSuchAlgorithmException(this.algName + " not supported"); - } } /**