当前位置: 首页>>代码示例>>Java>>正文


Java Constants.SignatureSpecNS方法代码示例

本文整理汇总了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);
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:18,代码来源:Reference.java

示例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();
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:60,代码来源:Reference.java

示例3: getBaseNamespace

import org.apache.xml.security.utils.Constants; //导入方法依赖的package包/类
/** @inheritDoc */
public String getBaseNamespace() {
    return Constants.SignatureSpecNS;
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:5,代码来源:MessageDigestAlgorithm.java

示例4: getBaseNamespace

import org.apache.xml.security.utils.Constants; //导入方法依赖的package包/类
/**
 * Method getBaseNamespace
 *
 * @return URI of this element
 */
public String getBaseNamespace() {
    return Constants.SignatureSpecNS;
}
 
开发者ID:Legostaev,项目名称:xmlsec-gost,代码行数:9,代码来源:SignatureAlgorithm.java


注:本文中的org.apache.xml.security.utils.Constants.SignatureSpecNS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。