/** * Creates a <code>DOMDigestMethod</code>. * * @param params the algorithm-specific params (may be <code>null</code>) * @throws InvalidAlgorithmParameterException if the parameters are not * appropriate for this digest method */ DOMDigestMethod(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException { if (params != null && !(params instanceof DigestMethodParameterSpec)) { throw new InvalidAlgorithmParameterException ("params must be of type DigestMethodParameterSpec"); } checkParams((DigestMethodParameterSpec)params); this.params = (DigestMethodParameterSpec)params; }
/** * Creates a <code>DOMDigestMethod</code>. * * @param params the algorithm-specific params (may be <code>null</code>) * @throws InvalidAlgorithmParameterException if the parameters are not * appropriate for this digest method */ DOMDigestMethod(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException { if (params != null && !(params instanceof DigestMethodParameterSpec)) { throw new InvalidAlgorithmParameterException ("params must be of type DigestMethodParameterSpec"); } checkParams((DigestMethodParameterSpec) params); this.params = (DigestMethodParameterSpec) params; }
public DigestMethod newDigestMethod(String algorithm, DigestMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { throw new UnsupportedOperationException(); }
@Nonnull @OverrideOnDemand protected DigestMethod createDigestMethod (@Nonnull final XMLSignatureFactory aSignatureFactory) throws Exception { return aSignatureFactory.newDigestMethod (DigestMethod.SHA1, (DigestMethodParameterSpec) null); }
/** * Checks if the specified parameters are valid for this algorithm. By * default, this method throws an exception if parameters are specified * since most DigestMethod algorithms do not have parameters. Subclasses * should override it if they have parameters. * * @param params the algorithm-specific params (may be <code>null</code>) * @throws InvalidAlgorithmParameterException if the parameters are not * appropriate for this digest method */ void checkParams(DigestMethodParameterSpec params) throws InvalidAlgorithmParameterException { if (params != null) { throw new InvalidAlgorithmParameterException("no parameters " + "should be specified for the " + getMessageDigestAlgorithm() + " DigestMethod algorithm"); } }
/** * Unmarshals <code>DigestMethodParameterSpec</code> from the specified * <code>Element</code>. By default, this method throws an exception since * most DigestMethod algorithms do not have parameters. Subclasses should * override it if they have parameters. * * @param paramsElem the <code>Element</code> holding the input params * @return the algorithm-specific <code>DigestMethodParameterSpec</code> * @throws MarshalException if the parameters cannot be unmarshalled */ DigestMethodParameterSpec unmarshalParams(Element paramsElem) throws MarshalException { throw new MarshalException("no parameters should " + "be specified for the " + getMessageDigestAlgorithm() + " DigestMethod algorithm"); }