pSource = new PSource.PSpecified(oaepParams);
pSource = new PSource.PSpecified(oaepParams);
pSource = new PSource.PSpecified(oaepParams);
byte[] oaepParams = getSecurityProperties().getEncryptionKeyTransportOAEPParams(); if (oaepParams != null) { pSource = new PSource.PSpecified(oaepParams);
byte[] oaepParams = getSecurityProperties().getEncryptionKeyTransportOAEPParams(); if (oaepParams != null) { pSource = new PSource.PSpecified(oaepParams);
byte[] pSourceBytes = EncryptionUtils.getPSource(encryptedKeyElement); if (pSourceBytes != null) { pSource = new PSource.PSpecified(pSourceBytes);
throw new IOException("Error reading ASN.1 encoding"); pSpecified = new PSource.PSpecified( NativeCrypto.asn1_read_octetstring(pSourceSeqRef)); if (!NativeCrypto.asn1_read_is_empty(pSourceSeqRef)) {
throw new IOException("Error reading ASN.1 encoding"); pSpecified = new PSource.PSpecified( NativeCrypto.asn1_read_octetstring(pSourceSeqRef)); if (!NativeCrypto.asn1_read_is_empty(pSourceSeqRef)) {
@Override protected AlgorithmParameters engineGetParameters() { if (!isInitialized()) { return null; } try { AlgorithmParameters params = AlgorithmParameters.getInstance("OAEP"); final PSource pSrc; if (label == null) { pSrc = PSource.PSpecified.DEFAULT; } else { pSrc = new PSource.PSpecified(label); } params.init(new OAEPParameterSpec( EvpMdRef.getJcaDigestAlgorithmStandardNameFromEVP_MD(oaepMd), EvpMdRef.MGF1_ALGORITHM_NAME, new MGF1ParameterSpec( EvpMdRef.getJcaDigestAlgorithmStandardNameFromEVP_MD(mgf1Md)), pSrc)); return params; } catch (NoSuchAlgorithmException e) { // We should not get here. throw (Error) new AssertionError("OAEP not supported").initCause(e); } catch (InvalidParameterSpecException e) { throw new RuntimeException("No providers of AlgorithmParameters.OAEP available"); } }
protected void engineInit( byte[] params) throws IOException { try { RSAESOAEPparams oaepP = RSAESOAEPparams.getInstance(params); if (!oaepP.getMaskGenAlgorithm().getAlgorithm().equals(PKCSObjectIdentifiers.id_mgf1)) { throw new IOException("unknown mask generation function: " + oaepP.getMaskGenAlgorithm().getAlgorithm()); } currentSpec = new OAEPParameterSpec( MessageDigestUtils.getDigestName(oaepP.getHashAlgorithm().getAlgorithm()), OAEPParameterSpec.DEFAULT.getMGFAlgorithm(), new MGF1ParameterSpec(MessageDigestUtils.getDigestName(AlgorithmIdentifier.getInstance(oaepP.getMaskGenAlgorithm().getParameters()).getAlgorithm())), new PSource.PSpecified(ASN1OctetString.getInstance(oaepP.getPSourceAlgorithm().getParameters()).getOctets())); } catch (ClassCastException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } }
protected void engineInit( byte[] params) throws IOException { try { RSAESOAEPparams oaepP = RSAESOAEPparams.getInstance(params); if (!oaepP.getMaskGenAlgorithm().getAlgorithm().equals(PKCSObjectIdentifiers.id_mgf1)) { throw new IOException("unknown mask generation function: " + oaepP.getMaskGenAlgorithm().getAlgorithm()); } currentSpec = new OAEPParameterSpec( MessageDigestUtils.getDigestName(oaepP.getHashAlgorithm().getAlgorithm()), OAEPParameterSpec.DEFAULT.getMGFAlgorithm(), new MGF1ParameterSpec(MessageDigestUtils.getDigestName(AlgorithmIdentifier.getInstance(oaepP.getMaskGenAlgorithm().getParameters()).getAlgorithm())), new PSource.PSpecified(ASN1OctetString.getInstance(oaepP.getPSourceAlgorithm().getParameters()).getOctets())); } catch (ClassCastException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } }
@Override protected AlgorithmParameters engineGetParameters() { if (!isInitialized()) { return null; } try { AlgorithmParameters params = AlgorithmParameters.getInstance("OAEP"); final PSource pSrc; if (label == null) { pSrc = PSource.PSpecified.DEFAULT; } else { pSrc = new PSource.PSpecified(label); } params.init(new OAEPParameterSpec( EvpMdRef.getJcaDigestAlgorithmStandardNameFromEVP_MD(oaepMd), EvpMdRef.MGF1_ALGORITHM_NAME, new MGF1ParameterSpec( EvpMdRef.getJcaDigestAlgorithmStandardNameFromEVP_MD(mgf1Md)), pSrc)); return params; } catch (NoSuchAlgorithmException e) { // We should not get here. throw (Error) new AssertionError("OAEP not supported").initCause(e); } catch (InvalidParameterSpecException e) { throw new RuntimeException("No providers of AlgorithmParameters.OAEP available"); } }
protected void engineInit( byte[] params) throws IOException { try { RSAESOAEPparams oaepP = RSAESOAEPparams.getInstance(params); currentSpec = new OAEPParameterSpec( oaepP.getHashAlgorithm().getAlgorithm().getId(), oaepP.getMaskGenAlgorithm().getAlgorithm().getId(), new MGF1ParameterSpec(AlgorithmIdentifier.getInstance(oaepP.getMaskGenAlgorithm().getParameters()).getAlgorithm().getId()), new PSource.PSpecified(ASN1OctetString.getInstance(oaepP.getPSourceAlgorithm().getParameters()).getOctets())); } catch (ClassCastException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } }
protected void engineInit( byte[] params) throws IOException { try { RSAESOAEPparams oaepP = RSAESOAEPparams.getInstance(params); currentSpec = new OAEPParameterSpec( oaepP.getHashAlgorithm().getAlgorithm().getId(), oaepP.getMaskGenAlgorithm().getAlgorithm().getId(), new MGF1ParameterSpec(AlgorithmIdentifier.getInstance(oaepP.getMaskGenAlgorithm().getParameters()).getAlgorithm().getId()), new PSource.PSpecified(ASN1OctetString.getInstance(oaepP.getPSourceAlgorithm().getParameters()).getOctets())); } catch (ClassCastException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } }
protected void engineInit( byte[] params) throws IOException { try { RSAESOAEPparams oaepP = RSAESOAEPparams.getInstance(params); currentSpec = new OAEPParameterSpec( oaepP.getHashAlgorithm().getAlgorithm().getId(), oaepP.getMaskGenAlgorithm().getAlgorithm().getId(), new MGF1ParameterSpec(AlgorithmIdentifier.getInstance(oaepP.getMaskGenAlgorithm().getParameters()).getAlgorithm().getId()), new PSource.PSpecified(ASN1OctetString.getInstance(oaepP.getPSourceAlgorithm().getParameters()).getOctets())); } catch (ClassCastException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } }
protected void engineInit( byte[] params) throws IOException { try { RSAESOAEPparams oaepP = RSAESOAEPparams.getInstance(params); currentSpec = new OAEPParameterSpec( oaepP.getHashAlgorithm().getAlgorithm().getId(), oaepP.getMaskGenAlgorithm().getAlgorithm().getId(), new MGF1ParameterSpec(AlgorithmIdentifier.getInstance(oaepP.getMaskGenAlgorithm().getParameters()).getAlgorithm().getId()), new PSource.PSpecified(ASN1OctetString.getInstance(oaepP.getPSourceAlgorithm().getParameters()).getOctets())); } catch (ClassCastException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Not a valid OAEP Parameter encoding."); } }