本文整理汇总了Java中org.apache.xml.security.utils.Constants.SignatureSpecNS方法的典型用法代码示例。如果您正苦于以下问题:Java Constants.SignatureSpecNS方法的具体用法?Java Constants.SignatureSpecNS怎么用?Java Constants.SignatureSpecNS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xml.security.utils.Constants
的用法示例。
在下文中一共展示了Constants.SignatureSpecNS方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDigestValue
import org.apache.xml.security.utils.Constants; //导入方法依赖的package包/类
/**
* Returns the digest value.
*
* @return the digest value.
* @throws Base64DecodingException if Reference contains no proper base64 encoded data.
* @throws XMLSecurityException if the Reference does not contain a DigestValue element
*/
public byte[] getDigestValue() throws Base64DecodingException, XMLSecurityException {
if (digestValueElement == null) {
// The required element is not in the XML!
Object[] exArgs ={ Constants._TAG_DIGESTVALUE, Constants.SignatureSpecNS };
throw new XMLSecurityException(
"signature.Verification.NoSignatureElement", exArgs
);
}
return Base64.decode(digestValueElement);
}
示例2: Reference
import org.apache.xml.security.utils.Constants; //导入方法依赖的package包/类
/**
* Constructor Reference
*
* @param doc the {@link Document} in which <code>XMLsignature</code> is placed
* @param baseURI the URI of the resource where the XML instance will be stored
* @param referenceURI URI indicate where is data which will digested
* @param manifest
* @param transforms {@link Transforms} applied to data
* @param messageDigestAlgorithm {@link MessageDigestAlgorithm Digest algorithm} which is
* applied to the data
* TODO should we throw XMLSignatureException if MessageDigestAlgoURI is wrong?
* @throws XMLSignatureException
*/
protected Reference(
Document doc, String baseURI, String referenceURI, Manifest manifest,
Transforms transforms, String messageDigestAlgorithm
) throws XMLSignatureException {
super(doc);
addReturnToSelf();
this.baseURI = baseURI;
this.manifest = manifest;
this.setURI(referenceURI);
// important: The ds:Reference must be added to the associated ds:Manifest
// or ds:SignedInfo _before_ the this.resolverResult() is called.
// this.manifest.appendChild(this.constructionElement);
// this.manifest.appendChild(this.doc.createTextNode("\n"));
if (transforms != null) {
this.transforms = transforms;
appendSelf(transforms);
addReturnToSelf();
}
// Create DigestMethod Element without actually instantiating a MessageDigest Object
Algorithm digestAlgorithm = new Algorithm(getDocument(), messageDigestAlgorithm) {
public String getBaseNamespace() {
return Constants.SignatureSpecNS;
}
public String getBaseLocalName() {
return Constants._TAG_DIGESTMETHOD;
}
};
digestMethodElem = digestAlgorithm.getElement();
appendSelf(digestMethodElem);
addReturnToSelf();
digestValueElement =
XMLUtils.createElementInSignatureSpace(getDocument(), Constants._TAG_DIGESTVALUE);
appendSelf(digestValueElement);
addReturnToSelf();
}
示例3: getBaseNamespace
import org.apache.xml.security.utils.Constants; //导入方法依赖的package包/类
/** @inheritDoc */
public String getBaseNamespace() {
return Constants.SignatureSpecNS;
}
示例4: getBaseNamespace
import org.apache.xml.security.utils.Constants; //导入方法依赖的package包/类
/**
* Method getBaseNamespace
*
* @return URI of this element
*/
public String getBaseNamespace() {
return Constants.SignatureSpecNS;
}