return new ApacheNodeSetData(new XMLSignatureInput(root));
/** * Proxy method for {@link SignedInfo#createSecretKey(byte[])}. If you want * to create a MAC, this method helps you to obtain the * {@link javax.crypto.SecretKey} from octets. * * @param secretKeyBytes * @return the secret key created. * @see SignedInfo#createSecretKey(byte[]) */ public SecretKey createSecretKey(byte[] secretKeyBytes) { return this.getSignedInfo().createSecretKey(secretKeyBytes); }
/** * Adds a {@link ResourceResolverSpi} to enable the retrieval of resources. * * @param resolver */ public void addResourceResolver(ResourceResolverSpi resolver) { this.getSignedInfo().addResourceResolver(resolver); }
/** {@inheritDoc} */ @Override public XMLSignatureInput engineResolveURI(ResourceResolverContext context) { XMLSignatureInput input = new XMLSignatureInput(inStream); input.setSecureValidation(context.secureValidation); return input; }
/** * Method engineSetHMACOutputLength * * @param HMACOutputLength * @throws XMLSignatureException */ protected void engineSetHMACOutputLength(int HMACOutputLength) throws XMLSignatureException { throw new XMLSignatureException("algorithms.HMACOutputLengthOnlyForHMAC"); }
/** * Method getReferencedContentPriorTransformsItem * * @param i * @return The contents before transformation of the reference i. * @throws XMLSecurityException */ public XMLSignatureInput getReferencedContentBeforeTransformsItem(int i) throws XMLSecurityException { return this.item(i).getContentsBeforeTransformation(); }
/** * Method getReferencedContentAfterTransformsItem * * @param i * @return The contents after transformation of the reference i. * @throws XMLSecurityException */ public XMLSignatureInput getReferencedContentAfterTransformsItem(int i) throws XMLSecurityException { return this.item(i).getContentsAfterTransformation(); }
/** * Method getHTMLRepresentation * * @throws XMLSignatureException * @return The HTML representation for this XMLSignature */ public String getHTMLRepresentation() throws XMLSignatureException { XMLSignatureInputDebugger db = new XMLSignatureInputDebugger(this); return db.getHTMLRepresentation(); }
/** * Method setVerificationResult * * @param index * @param verify */ private void setVerificationResult(int index, boolean verify) { if (this.verificationResults == null) { this.verificationResults = new boolean[this.getLength()]; } this.verificationResults[index] = verify; }
/** * Sets the <code>Id</code> attribute * * @param Id the <code>Id</code> attribute in <code>ds:Manifest</code> */ public void setId(String Id) { if (Id != null) { setLocalIdAttribute(Constants._ATT_ID, Id); } }
/** * Sets the <code>Id</code> attribute * * @param Id <code>Id</code> attribute */ public void setId(String Id) { if (Id != null) { setLocalIdAttribute(Constants._ATT_ID, Id); } }
/** * Return the <code>type</code> atttibute of the Reference indicate whether an * <code>ds:Object</code>, <code>ds:SignatureProperty</code>, or <code>ds:Manifest</code> * element * * @return the <code>type</code> attribute of the Reference */ public String getType() { return getLocalAttribute(Constants._ATT_TYPE); }
/** * Returns the <code>Encoding</code> attribute * * @return the <code>Encoding</code> attribute */ public String getEncoding() { return getLocalAttribute(Constants._ATT_ENCODING); }
/** * Adds child Node * * @param node child Node * @return the new node in the tree. */ public Node appendChild(Node node) { appendSelf(node); return node; }
/** * Adds a {@link ResourceResolver} to enable the retrieval of resources. * * @param resolver */ public void addResourceResolver(ResourceResolver resolver) { this.getSignedInfo().addResourceResolver(resolver); }
/** * Method engineInitSign * * @param secretKey * @param secureRandom * @throws XMLSignatureException */ protected void engineInitSign(Key secretKey, SecureRandom secureRandom) throws XMLSignatureException { throw new XMLSignatureException("algorithms.CannotUseSecureRandomOnMAC"); }
/** * Method getSignedContentLength * * @return The number of references contained in this reference. */ public int getSignedContentLength() { return this.getLength(); }
/** {@inheritDoc} */ protected void engineSetHMACOutputLength(int HMACOutputLength) throws XMLSignatureException { throw new XMLSignatureException("algorithms.HMACOutputLengthOnlyForHMAC"); }
/** {@inheritDoc} */ protected void engineInitSign( Key signingKey, AlgorithmParameterSpec algorithmParameterSpec ) throws XMLSignatureException { throw new XMLSignatureException("algorithms.CannotUseAlgorithmParameterSpecOnRSA"); }
/** * Method engineInitSign * * @param signingKey * @param algorithmParameterSpec * @throws XMLSignatureException */ protected void engineInitSign( Key signingKey, AlgorithmParameterSpec algorithmParameterSpec ) throws XMLSignatureException { throw new XMLSignatureException("algorithms.CannotUseAlgorithmParameterSpecOnDSA"); }