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


Java DOMCryptoContext类代码示例

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


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

示例1: marshal

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
/**
 * This method invokes the {@link #marshalParams marshalParams}
 * method to marshal any algorithm-specific parameters.
 */
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
    throws MarshalException
{
    Document ownerDoc = DOMUtils.getOwnerDocument(parent);

    Element smElem = DOMUtils.createElement(ownerDoc, "SignatureMethod",
                                            XMLSignature.XMLNS, dsPrefix);
    DOMUtils.setAttribute(smElem, "Algorithm", getAlgorithm());

    if (getParameterSpec() != null) {
        marshalParams(smElem, dsPrefix);
    }

    parent.appendChild(smElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:AbstractDOMSignatureMethod.java

示例2: marshal

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
    throws MarshalException
{
    ownerDoc = DOMUtils.getOwnerDocument(parent);
    Element siElem = DOMUtils.createElement(ownerDoc, "SignedInfo",
                                            XMLSignature.XMLNS, dsPrefix);

    // create and append CanonicalizationMethod element
    DOMCanonicalizationMethod dcm =
        (DOMCanonicalizationMethod)canonicalizationMethod;
    dcm.marshal(siElem, dsPrefix, context);

    // create and append SignatureMethod element
    ((DOMStructure)signatureMethod).marshal(siElem, dsPrefix, context);

    // create and append Reference elements
    for (Reference reference : references) {
        ((DOMReference)reference).marshal(siElem, dsPrefix, context);
    }

    // append Id attribute
    DOMUtils.setAttributeID(siElem, "Id", id);

    parent.appendChild(siElem);
    localSiElem = siElem;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:DOMSignedInfo.java

示例3: init

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
public void init(XMLStructure parent, XMLCryptoContext context)
    throws InvalidAlgorithmParameterException
{
    if (context != null && !(context instanceof DOMCryptoContext)) {
        throw new ClassCastException
            ("context must be of type DOMCryptoContext");
    }
    if (parent == null) {
        throw new NullPointerException();
    }
    if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
        throw new ClassCastException("parent must be of type DOMStructure");
    }
    transformElem = (Element)
        ((javax.xml.crypto.dom.DOMStructure) parent).getNode();
    ownerDoc = DOMUtils.getOwnerDocument(transformElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ApacheTransform.java

示例4: marshalParams

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    if (context != null && !(context instanceof DOMCryptoContext)) {
        throw new ClassCastException
            ("context must be of type DOMCryptoContext");
    }
    if (parent == null) {
        throw new NullPointerException();
    }
    if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
        throw new ClassCastException("parent must be of type DOMStructure");
    }
    transformElem = (Element)
        ((javax.xml.crypto.dom.DOMStructure) parent).getNode();
    ownerDoc = DOMUtils.getOwnerDocument(transformElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ApacheTransform.java

示例5: marshal

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
    throws MarshalException
{
    Document ownerDoc = DOMUtils.getOwnerDocument(parent);
    Element propElem = DOMUtils.createElement(ownerDoc, "SignatureProperty",
                                              XMLSignature.XMLNS, dsPrefix);

    // set attributes
    DOMUtils.setAttributeID(propElem, "Id", id);
    DOMUtils.setAttribute(propElem, "Target", target);

    // create and append any elements and mixed content
    for (XMLStructure property : content) {
        DOMUtils.appendChild(propElem,
            ((javax.xml.crypto.dom.DOMStructure)property).getNode());
    }

    parent.appendChild(propElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DOMSignatureProperty.java

示例6: marshal

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
/**
 * This method invokes the abstract {@link #marshalParams marshalParams}
 * method to marshal any algorithm-specific parameters.
 */
public void marshal(Node parent, String prefix, DOMCryptoContext context)
    throws MarshalException
{
    Document ownerDoc = DOMUtils.getOwnerDocument(parent);

    Element dmElem = DOMUtils.createElement(ownerDoc, "DigestMethod",
                                            XMLSignature.XMLNS, prefix);
    DOMUtils.setAttribute(dmElem, "Algorithm", getAlgorithm());

    if (params != null) {
        marshalParams(dmElem, prefix);
    }

    parent.appendChild(dmElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DOMDigestMethod.java

示例7: marshal

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
    throws MarshalException
{
    Document ownerDoc = DOMUtils.getOwnerDocument(parent);
    Element propsElem = DOMUtils.createElement(ownerDoc,
                                               "SignatureProperties",
                                               XMLSignature.XMLNS,
                                               dsPrefix);

    // set attributes
    DOMUtils.setAttributeID(propsElem, "Id", id);

    // create and append any properties
    for (SignatureProperty property : properties) {
        ((DOMSignatureProperty)property).marshal(propsElem, dsPrefix,
                                                 context);
    }

    parent.appendChild(propsElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:DOMSignatureProperties.java

示例8: init

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
public void init(XMLStructure parent, XMLCryptoContext context)
    throws InvalidAlgorithmParameterException
{
    if (context != null && !(context instanceof DOMCryptoContext)) {
        throw new ClassCastException
            ("context must be of type DOMCryptoContext");
    }
    if (parent == null) {
        throw new NullPointerException();
    }
    if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
        throw new ClassCastException("parent must be of type DOMStructure");
    }
    transformElem = (Element)
        ((javax.xml.crypto.dom.DOMStructure)parent).getNode();
    ownerDoc = DOMUtils.getOwnerDocument(transformElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ApacheCanonicalizer.java

示例9: marshalParams

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    if (context != null && !(context instanceof DOMCryptoContext)) {
        throw new ClassCastException
            ("context must be of type DOMCryptoContext");
    }
    if (parent == null) {
        throw new NullPointerException();
    }
    if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
        throw new ClassCastException("parent must be of type DOMStructure");
    }
    transformElem = (Element)
        ((javax.xml.crypto.dom.DOMStructure)parent).getNode();
    ownerDoc = DOMUtils.getOwnerDocument(transformElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ApacheCanonicalizer.java

示例10: marshal

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
/**
 * This method invokes the abstract {@link #marshalParams marshalParams}
 * method to marshal any algorithm-specific parameters.
 */
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
    throws MarshalException
{
    Document ownerDoc = DOMUtils.getOwnerDocument(parent);

    Element transformElem = null;
    if (parent.getLocalName().equals("Transforms")) {
        transformElem = DOMUtils.createElement(ownerDoc, "Transform",
                                               XMLSignature.XMLNS,
                                               dsPrefix);
    } else {
        transformElem = DOMUtils.createElement(ownerDoc,
                                               "CanonicalizationMethod",
                                               XMLSignature.XMLNS,
                                               dsPrefix);
    }
    DOMUtils.setAttribute(transformElem, "Algorithm", getAlgorithm());

    spi.marshalParams(new javax.xml.crypto.dom.DOMStructure(transformElem),
                      context);

    parent.appendChild(transformElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:DOMTransform.java

示例11: marshal

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
    throws MarshalException
{
    Document ownerDoc = DOMUtils.getOwnerDocument(parent);

    Element isElem = DOMUtils.createElement(ownerDoc, "X509IssuerSerial",
                                            XMLSignature.XMLNS, dsPrefix);
    Element inElem = DOMUtils.createElement(ownerDoc, "X509IssuerName",
                                            XMLSignature.XMLNS, dsPrefix);
    Element snElem = DOMUtils.createElement(ownerDoc, "X509SerialNumber",
                                            XMLSignature.XMLNS, dsPrefix);
    inElem.appendChild(ownerDoc.createTextNode(issuerName));
    snElem.appendChild(ownerDoc.createTextNode(serialNumber.toString()));
    isElem.appendChild(inElem);
    isElem.appendChild(snElem);
    parent.appendChild(isElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:DOMX509IssuerSerial.java

示例12: marshalPublicKey

import javax.xml.crypto.dom.DOMCryptoContext; //导入依赖的package包/类
void marshalPublicKey(Node parent, Document doc, String dsPrefix,
    DOMCryptoContext context) throws MarshalException {
    Element rsaElem = DOMUtils.createElement(doc, "RSAKeyValue",
                                             XMLSignature.XMLNS,
                                             dsPrefix);
    Element modulusElem = DOMUtils.createElement(doc, "Modulus",
                                                 XMLSignature.XMLNS,
                                                 dsPrefix);
    Element exponentElem = DOMUtils.createElement(doc, "Exponent",
                                                  XMLSignature.XMLNS,
                                                  dsPrefix);
    modulus.marshal(modulusElem, dsPrefix, context);
    exponent.marshal(exponentElem, dsPrefix, context);
    rsaElem.appendChild(modulusElem);
    rsaElem.appendChild(exponentElem);
    parent.appendChild(rsaElem);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:DOMKeyValue.java


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