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


Java SignatureAlgorithm类代码示例

本文整理汇总了Java中com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm的典型用法代码示例。如果您正苦于以下问题:Java SignatureAlgorithm类的具体用法?Java SignatureAlgorithm怎么用?Java SignatureAlgorithm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SignatureAlgorithm类属于com.sun.org.apache.xml.internal.security.algorithms包,在下文中一共展示了SignatureAlgorithm类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SignedInfo

import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm; //导入依赖的package包/类
/**
 * Constructor SignedInfo
 *
 * @param doc <code>SignedInfo</code> is placed in this document
 * @param signatureMethodURI URI representation of the Digest and
 *    Signature algorithm
 * @param hMACOutputLength
 * @param canonicalizationMethodURI URI representation of the
 *    Canonicalization method
 * @throws XMLSecurityException
 */
public SignedInfo(
    Document doc, String signatureMethodURI,
    int hMACOutputLength, String canonicalizationMethodURI
) throws XMLSecurityException {
    super(doc);

    c14nMethod =
        XMLUtils.createElementInSignatureSpace(this.doc, Constants._TAG_CANONICALIZATIONMETHOD);

    c14nMethod.setAttributeNS(null, Constants._ATT_ALGORITHM, canonicalizationMethodURI);
    this.constructionElement.appendChild(c14nMethod);
    XMLUtils.addReturnToElement(this.constructionElement);

    if (hMACOutputLength > 0) {
        this.signatureAlgorithm =
            new SignatureAlgorithm(this.doc, signatureMethodURI, hMACOutputLength);
    } else {
        this.signatureAlgorithm = new SignatureAlgorithm(this.doc, signatureMethodURI);
    }

    signatureMethod = this.signatureAlgorithm.getElement();
    this.constructionElement.appendChild(signatureMethod);
    XMLUtils.addReturnToElement(this.constructionElement);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:SignedInfo.java

示例2: SignedInfo

import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm; //导入依赖的package包/类
/**
 * @param doc
 * @param signatureMethodElem
 * @param canonicalizationMethodElem
 * @throws XMLSecurityException
 */
public SignedInfo(Document doc, Element signatureMethodElem,
    Element canonicalizationMethodElem) throws XMLSecurityException {

    super(doc);
    // Check this?
    this.c14nMethod = canonicalizationMethodElem;
    this._constructionElement.appendChild(c14nMethod);
    XMLUtils.addReturnToElement(this._constructionElement);

    this._signatureAlgorithm =
        new SignatureAlgorithm(signatureMethodElem, null);

    signatureMethod = this._signatureAlgorithm.getElement();
    this._constructionElement.appendChild(signatureMethod);

    XMLUtils.addReturnToElement(this._constructionElement);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:24,代码来源:SignedInfo.java

示例3: dynamicInit

import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm; //导入依赖的package包/类
/**
 * Dynamically initialise the library by registering the default algorithms/implementations
 */
private static void dynamicInit() {
    //
    // Load the Resource Bundle - the default is the English resource bundle.
    // To load another resource bundle, call I18n.init(...) before calling this
    // method.
    //
    I18n.init("en", "US");

    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Registering default algorithms");
    }
    try {
        AccessController.doPrivileged(new PrivilegedExceptionAction<Void>(){
            @Override public Void run() throws XMLSecurityException {
                //
                // Bind the default prefixes
                //
                ElementProxy.registerDefaultPrefixes();

                //
                // Set the default Transforms
                //
                Transform.registerDefaultAlgorithms();

                //
                // Set the default signature algorithms
                //
                SignatureAlgorithm.registerDefaultAlgorithms();

                //
                // Set the default JCE algorithms
                //
                JCEMapper.registerDefaultAlgorithms();

                //
                // Set the default c14n algorithms
                //
                Canonicalizer.registerDefaultAlgorithms();

                //
                // Register the default resolvers
                //
                ResourceResolver.registerDefaultResolvers();

                //
                // Register the default key resolvers
                //
                KeyResolver.registerDefaultResolvers();

                return null;
            }
       });
    } catch (PrivilegedActionException ex) {
        XMLSecurityException xse = (XMLSecurityException)ex.getException();
        log.log(java.util.logging.Level.SEVERE, xse.getMessage(), xse);
        xse.printStackTrace();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:62,代码来源:Init.java

示例4: SignerOutputStream

import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm; //导入依赖的package包/类
/**
 * @param sa
 */
public SignerOutputStream(SignatureAlgorithm sa) {
    this.sa = sa;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:SignerOutputStream.java

示例5: getSignatureAlgorithm

import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm; //导入依赖的package包/类
protected SignatureAlgorithm getSignatureAlgorithm() {
    return signatureAlgorithm;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:SignedInfo.java


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