Java Code Examples for com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm

The following examples show how to use com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: jdk1.8-source-analysis   Source File: SignedInfo.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 2
Source Project: jdk1.8-source-analysis   Source File: SignedInfo.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 3
Source Project: dragonwell8_jdk   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 4
Source Project: dragonwell8_jdk   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 5
Source Project: TencentKona-8   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 6
Source Project: TencentKona-8   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 7
Source Project: jdk8u-dev-jdk   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 8
Source Project: jdk8u60   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 9
Source Project: jdk8u60   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 10
Source Project: jdk8u-jdk   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 11
Source Project: JDKSourceCode1.8   Source File: SignedInfo.java    License: MIT License 6 votes vote down vote up
/**
 * 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);
}
 
Example 12
Source Project: openjdk-jdk8u   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 13
Source Project: openjdk-jdk8u   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 14
/**
 * 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);
}
 
Example 15
Source Project: jdk8u-dev-jdk   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 16
Source Project: openjdk-jdk9   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 17
Source Project: openjdk-jdk9   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 18
Source Project: jdk8u-jdk   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 19
Source Project: hottub   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 20
Source Project: hottub   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 21
Source Project: openjdk-8-source   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 22
Source Project: openjdk-8-source   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 23
Source Project: openjdk-8   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 24
Source Project: openjdk-8   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @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);
}
 
Example 25
Source Project: jdk8u_jdk   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 26
Source Project: jdk8u-jdk   Source File: SignedInfo.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 27
Source Project: jdk1.8-source-analysis   Source File: SignerOutputStream.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * @param sa
 */
public SignerOutputStream(SignatureAlgorithm sa) {
    this.sa = sa;
}
 
Example 28
Source Project: jdk1.8-source-analysis   Source File: SignedInfo.java    License: Apache License 2.0 4 votes vote down vote up
protected SignatureAlgorithm getSignatureAlgorithm() {
    return signatureAlgorithm;
}
 
Example 29
Source Project: dragonwell8_jdk   Source File: Init.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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();
    }
}
 
Example 30
/**
 * @param sa
 */
public SignerOutputStream(SignatureAlgorithm sa) {
    this.sa = sa;
}