Code example for MGF1ParameterSpec

Methods: getDigestAlgorithm

0
                throw new InvalidParameterException("unkown MGF parameters");
            } 
             
            MGF1ParameterSpec   mgfParams = (MGF1ParameterSpec)paramSpec.getMGFParameters();
             
            if (!JCEDigestUtil.isSameDigest(mgfParams.getDigestAlgorithm(), paramSpec.getDigestAlgorithm()))
            { 
                throw new InvalidParameterException("digest algorithm for MGF should be the same as for PSS parameters.");
            } 
             
            digest = JCEDigestUtil.getDigest(mgfParams.getDigestAlgorithm());
             
            if (digest == null)
            { 
                throw new InvalidParameterException("no match on MGF digest algorithm: "+ mgfParams.getDigestAlgorithm());
            } 
             
            this.saltLength = paramSpec.getSaltLength();
            this.trailer = getTrailer(paramSpec.getTrailerField());
        } 
        else