📄 xmlsignaturefactory.java
字号:
* <code>null</code> * @throws IllegalArgumentException if <code>references</code> is empty * @throws ClassCastException if <code>references</code> contains any * entries that are not of type {@link Reference} */ public abstract Manifest newManifest(List references); /** * Creates a <code>Manifest</code> containing the specified * list of {@link Reference}s and optional id. * * @param references a list of one or more <code>Reference</code>s. The list * is defensively copied to protect against subsequent modification. * @param id the id (may be <code>null</code>) * @return a <code>Manifest</code> * @throws NullPointerException if <code>references</code> is * <code>null</code> * @throws IllegalArgumentException if <code>references</code> is empty * @throws ClassCastException if <code>references</code> contains any * entries that are not of type {@link Reference} */ public abstract Manifest newManifest(List references, String id); /** * Creates a <code>SignatureProperty</code> containing the specified * list of {@link XMLStructure}s, target URI and optional id. * * @param content a list of one or more <code>XMLStructure</code>s. The list * is defensively copied to protect against subsequent modification. * @param target the target URI of the Signature that this property applies * to * @param id the id (may be <code>null</code>) * @return a <code>SignatureProperty</code> * @throws NullPointerException if <code>content</code> or * <code>target</code> is <code>null</code> * @throws IllegalArgumentException if <code>content</code> is empty * @throws ClassCastException if <code>content</code> contains any * entries that are not of type {@link XMLStructure} */ public abstract SignatureProperty newSignatureProperty (List content, String target, String id); /** * Creates a <code>SignatureProperties</code> containing the specified * list of {@link SignatureProperty}s and optional id. * * @param properties a list of one or more <code>SignatureProperty</code>s. * The list is defensively copied to protect against subsequent * modification. * @param id the id (may be <code>null</code>) * @return a <code>SignatureProperties</code> * @throws NullPointerException if <code>properties</code> * is <code>null</code> * @throws IllegalArgumentException if <code>properties</code> is empty * @throws ClassCastException if <code>properties</code> contains any * entries that are not of type {@link SignatureProperty} */ public abstract SignatureProperties newSignatureProperties (List properties, String id); // Algorithm factory methods /** * Creates a <code>DigestMethod</code> for the specified algorithm URI * and parameters. * * @param algorithm the URI identifying the digest algorithm * @param params algorithm-specific digest parameters (may be * <code>null</code>) * @return the <code>DigestMethod</code> * @throws InvalidAlgorithmParameterException if the specified parameters * are inappropriate for the requested algorithm * @throws NoSuchAlgorithmException if an implementation of the * specified algorithm cannot be found * @throws NullPointerException if <code>algorithm</code> is * <code>null</code> */ public abstract DigestMethod newDigestMethod(String algorithm, DigestMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException; /** * Creates a <code>SignatureMethod</code> for the specified algorithm URI * and parameters. * * @param algorithm the URI identifying the signature algorithm * @param params algorithm-specific signature parameters (may be * <code>null</code>) * @return the <code>SignatureMethod</code> * @throws InvalidAlgorithmParameterException if the specified parameters * are inappropriate for the requested algorithm * @throws NoSuchAlgorithmException if an implementation of the * specified algorithm cannot be found * @throws NullPointerException if <code>algorithm</code> is * <code>null</code> */ public abstract SignatureMethod newSignatureMethod(String algorithm, SignatureMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException; /** * Creates a <code>Transform</code> for the specified algorithm URI * and parameters. * * @param algorithm the URI identifying the transform algorithm * @param params algorithm-specific transform parameters (may be * <code>null</code>) * @return the <code>Transform</code> * @throws InvalidAlgorithmParameterException if the specified parameters * are inappropriate for the requested algorithm * @throws NoSuchAlgorithmException if an implementation of the * specified algorithm cannot be found * @throws NullPointerException if <code>algorithm</code> is * <code>null</code> */ public abstract Transform newTransform(String algorithm, TransformParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException; /** * Creates a <code>Transform</code> for the specified algorithm URI * and parameters. The parameters are specified as a mechanism-specific * <code>XMLStructure</code> (ex: {@link DOMStructure}). This method is * useful when the parameters are in XML form or there is no standard * class for specifying the parameters. * * @param algorithm the URI identifying the transform algorithm * @param params a mechanism-specific XML structure from which to * unmarshal the parameters from (may be <code>null</code> if * not required or optional) * @return the <code>Transform</code> * @throws ClassCastException if the type of <code>params</code> is * inappropriate for this <code>XMLSignatureFactory</code> * @throws InvalidAlgorithmParameterException if the specified parameters * are inappropriate for the requested algorithm * @throws NoSuchAlgorithmException if an implementation of the * specified algorithm cannot be found * @throws NullPointerException if <code>algorithm</code> is * <code>null</code> */ public abstract Transform newTransform(String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException; /** * Creates a <code>CanonicalizationMethod</code> for the specified * algorithm URI and parameters. * * @param algorithm the URI identifying the canonicalization algorithm * @param params algorithm-specific canonicalization parameters (may be * <code>null</code>) * @return the <code>CanonicalizationMethod</code> * @throws InvalidAlgorithmParameterException if the specified parameters * are inappropriate for the requested algorithm * @throws NoSuchAlgorithmException if an implementation of the * specified algorithm cannot be found * @throws NullPointerException if <code>algorithm</code> is * <code>null</code> */ public abstract CanonicalizationMethod newCanonicalizationMethod( String algorithm, C14NMethodParameterSpec params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException; /** * Creates a <code>CanonicalizationMethod</code> for the specified * algorithm URI and parameters. The parameters are specified as a * mechanism-specific <code>XMLStructure</code> (ex: {@link DOMStructure}). * This method is useful when the parameters are in XML form or there is * no standard class for specifying the parameters. * * @param algorithm the URI identifying the canonicalization algorithm * @param params a mechanism-specific XML structure from which to * unmarshal the parameters from (may be <code>null</code> if * not required or optional) * @return the <code>CanonicalizationMethod</code> * @throws ClassCastException if the type of <code>params</code> is * inappropriate for this <code>XMLSignatureFactory</code> * @throws InvalidAlgorithmParameterException if the specified parameters * are inappropriate for the requested algorithm * @throws NoSuchAlgorithmException if an implementation of the * specified algorithm cannot be found * @throws NullPointerException if <code>algorithm</code> is * <code>null</code> */ public abstract CanonicalizationMethod newCanonicalizationMethod( String algorithm, XMLStructure params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException; /** * Returns a <code>KeyInfoFactory</code> that creates <code>KeyInfo</code> * objects. The returned <code>KeyInfoFactory</code> has the same * mechanism type and provider as this <code>XMLSignatureFactory</code>. * * @return a <code>KeyInfoFactory</code> * @throws NoSuchMechanismException if a <code>KeyFactory</code> * implementation with the same mechanism type and provider * is not available */ public final KeyInfoFactory getKeyInfoFactory() { return KeyInfoFactory.getInstance(getMechanismType(), getProvider()); } /** * Unmarshals a new <code>XMLSignature</code> instance from a * mechanism-specific <code>XMLValidateContext</code> instance. * * @param context a mechanism-specific context from which to unmarshal the * signature from * @return the <code>XMLSignature</code> * @throws NullPointerException if <code>context</code> is * <code>null</code> * @throws ClassCastException if the type of <code>context</code> is * inappropriate for this factory * @throws MarshalException if an unrecoverable exception occurs * during unmarshalling */ public abstract XMLSignature unmarshalXMLSignature (XMLValidateContext context) throws MarshalException; /** * Unmarshals a new <code>XMLSignature</code> instance from a * mechanism-specific <code>XMLStructure</code> instance. * This method is useful if you only want to unmarshal (and not * validate) an <code>XMLSignature</code>. * * @param xmlStructure a mechanism-specific XML structure from which to * unmarshal the signature from * @return the <code>XMLSignature</code> * @throws NullPointerException if <code>xmlStructure</code> is * <code>null</code> * @throws ClassCastException if the type of <code>xmlStructure</code> is * inappropriate for this factory * @throws MarshalException if an unrecoverable exception occurs * during unmarshalling */ public abstract XMLSignature unmarshalXMLSignature (XMLStructure xmlStructure) throws MarshalException; /** * Indicates whether a specified feature is supported. * * @param feature the feature name (as an absolute URI) * @return <code>true</code> if the specified feature is supported, * <code>false</code> otherwise * @throws NullPointerException if <code>feature</code> is <code>null</code> */ public abstract boolean isFeatureSupported(String feature); /** * Returns a reference to the <code>URIDereferencer</code> that is used by * default to dereference URIs in {@link Reference} objects. * * @return a reference to the default <code>URIDereferencer</code> (never * <code>null</code>) */ public abstract URIDereferencer getURIDereferencer();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -