Code example for OAEPParameterSpec

Methods: getMGFParametersgetPSource

0
        boolean                 privateKeyOnly,
        AsymmetricBlockCipher   engine)
    { 
        this.publicKeyOnly = publicKeyOnly;
        this.privateKeyOnly = privateKeyOnly;
        cipher = engine;
    } 
      
    private void initFromSpec( 
        OAEPParameterSpec pSpec) 
        throws NoSuchPaddingException 
    { 
        MGF1ParameterSpec   mgfParams = (MGF1ParameterSpec)pSpec.getMGFParameters();
        Digest              digest = JCEDigestUtil.getDigest(mgfParams.getDigestAlgorithm());
         
        if (digest == null)
        { 
            throw new NoSuchPaddingException("no match on OAEP constructor for digest algorithm: "+ mgfParams.getDigestAlgorithm());
        }