Java 类javax.xml.crypto.dsig.spec.ExcC14NParameterSpec 实例源码

项目:OpenJSharp    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:jdk8u-jdk    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:openjdk-jdk10    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:openjdk9    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:xmlsec-gost    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:jdk8u_jdk    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:lookaside_java-1.8.0-openjdk    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:infobip-open-jdk-8    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:jdk8u-dev-jdk    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:jdk7-jdk    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List prefixList = new ArrayList();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:openjdk-source-code-learn    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List prefixList = new ArrayList();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:OLD-OpenJDK8    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List<String> prefixList = new ArrayList<String>();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:openjdk-jdk7u-jdk    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List prefixList = new ArrayList();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:openjdk-icedtea7    文件:DOMExcC14NMethod.java   
private void unmarshalParams(Element paramsElem) {
    String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
    this.inclusiveNamespaces = prefixListAttr;
    int begin = 0;
    int end = prefixListAttr.indexOf(' ');
    List prefixList = new ArrayList();
    while (end != -1) {
        prefixList.add(prefixListAttr.substring(begin, end));
        begin = end + 1;
        end = prefixListAttr.indexOf(' ', begin);
    }
    if (begin <= prefixListAttr.length()) {
        prefixList.add(prefixListAttr.substring(begin));
    }
    this.params = new ExcC14NParameterSpec(prefixList);
}
项目:OpenJSharp    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:OpenJSharp    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    @SuppressWarnings("unchecked")
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:jdk8u-jdk    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:jdk8u-jdk    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    @SuppressWarnings("unchecked")
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:openjdk-jdk10    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:openjdk-jdk10    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuilder prefixListAttr = new StringBuilder("");
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:openjdk9    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:openjdk9    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuilder prefixListAttr = new StringBuilder("");
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:xmlsec-gost    文件:DOMExcC14NMethod.java   
@Override
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:xmlsec-gost    文件:DOMExcC14NMethod.java   
@Override
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    XmlWriterToTree xwriter = new XmlWriterToTree(Marshaller.getMarshallers(), transformElem);

    String prefix =
        DOMUtils.getNSPrefix(context, CanonicalizationMethod.EXCLUSIVE);
    xwriter.writeStartElement(prefix, "InclusiveNamespaces", CanonicalizationMethod.EXCLUSIVE);
    xwriter.writeNamespace(prefix, CanonicalizationMethod.EXCLUSIVE);

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuilder prefixListAttr = new StringBuilder("");
    List<String> prefixList = getParameterSpecPrefixList(params);
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    xwriter.writeAttribute("", "", "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    xwriter.writeEndElement(); // "InclusiveNamespaces"
}
项目:jdk8u_jdk    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:jdk8u_jdk    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    @SuppressWarnings("unchecked")
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:lookaside_java-1.8.0-openjdk    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    @SuppressWarnings("unchecked")
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:oiosaml.java    文件:OIOSoapEnvelope.java   
private Element signSignature(String id, Element env, KeyInfoFactory keyInfoFactory, X509Credential credential) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, MarshalException, XMLSignatureException {
    if (endorsingToken == null) return env;

    NodeList nl = env.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature");
    for (int i = 0; i < nl.getLength(); i++) {
        Element e = (Element) nl.item(i);
        if (e.hasAttributeNS(null, "Id")) {
            e.setAttributeNS(WSSecurityConstants.WSU_NS, "Id", e.getAttribute("Id"));
            e.setIdAttributeNS(WSSecurityConstants.WSU_NS, "Id", true);
        }
    }
    env = SAMLUtil.loadElementFromString(XMLHelper.nodeToString(env));


    DigestMethod digestMethod = xsf.newDigestMethod(DigestMethod.SHA1, null);
    List<Transform> transforms = new ArrayList<Transform>(2);
    transforms.add(xsf.newTransform("http://www.w3.org/2001/10/xml-exc-c14n#",new ExcC14NParameterSpec(Collections.singletonList("xsd"))));


    List<Reference> refs = new ArrayList<Reference>();
    Reference r = xsf.newReference("#"+id, digestMethod, transforms, null, null);
    refs.add(r);

    CanonicalizationMethod canonicalizationMethod = xsf.newCanonicalizationMethod(CanonicalizationMethod.EXCLUSIVE, (C14NMethodParameterSpec) null);
    SignatureMethod signatureMethod = xsf.newSignatureMethod(SignatureMethod.RSA_SHA1, null);
    SignedInfo signedInfo = xsf.newSignedInfo(canonicalizationMethod, signatureMethod, refs);

    KeyInfo ki = generateKeyInfo(credential, keyInfoFactory, false);
    XMLSignature signature = xsf.newXMLSignature(signedInfo, ki);

       Node security = env.getElementsByTagNameNS(WSSecurityConstants.WSSE_NS, "Security").item(0);

       DOMSignContext signContext = new DOMSignContext(credential.getPrivateKey(), security); 
       signContext.putNamespacePrefix(SAMLConstants.XMLSIG_NS, SAMLConstants.XMLSIG_PREFIX);
       signContext.putNamespacePrefix(SAMLConstants.XMLENC_NS, SAMLConstants.XMLENC_PREFIX);

       signature.sign(signContext);

       return env;
}
项目:infobip-open-jdk-8    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:infobip-open-jdk-8    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    @SuppressWarnings("unchecked")
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:jdk8u-dev-jdk    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:jdk8u-dev-jdk    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    @SuppressWarnings("unchecked")
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:jdk7-jdk    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException {
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec) params;
    }
}
项目:jdk7-jdk    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException {

    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix =
        DOMUtils.getNSPrefix(context, CanonicalizationMethod.EXCLUSIVE);
    Element excElem = DOMUtils.createElement
        (ownerDoc, "InclusiveNamespaces",
         CanonicalizationMethod.EXCLUSIVE, prefix);
    if (prefix == null || prefix.length() == 0) {
        excElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
            CanonicalizationMethod.EXCLUSIVE);
    } else {
        excElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
            "xmlns:" + prefix, CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec) spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    List prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append((String) prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(excElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(excElem);
}
项目:openjdk-source-code-learn    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException {
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec) params;
    }
}
项目:openjdk-source-code-learn    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException {

    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix =
        DOMUtils.getNSPrefix(context, CanonicalizationMethod.EXCLUSIVE);
    Element excElem = DOMUtils.createElement
        (ownerDoc, "InclusiveNamespaces",
         CanonicalizationMethod.EXCLUSIVE, prefix);
    if (prefix == null || prefix.length() == 0) {
        excElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
            CanonicalizationMethod.EXCLUSIVE);
    } else {
        excElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
            "xmlns:" + prefix, CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec) spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    List prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append((String) prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(excElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(excElem);
}
项目:OLD-OpenJDK8    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException
{
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec)params;
    }
}
项目:OLD-OpenJDK8    文件:DOMExcC14NMethod.java   
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
    throws MarshalException
{
    super.marshalParams(parent, context);
    AlgorithmParameterSpec spec = getParameterSpec();
    if (spec == null) {
        return;
    }

    String prefix = DOMUtils.getNSPrefix(context,
                                         CanonicalizationMethod.EXCLUSIVE);
    Element eElem = DOMUtils.createElement(ownerDoc,
                                           "InclusiveNamespaces",
                                           CanonicalizationMethod.EXCLUSIVE,
                                           prefix);
    if (prefix == null || prefix.length() == 0) {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
                             CanonicalizationMethod.EXCLUSIVE);
    } else {
        eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                               "xmlns:" + prefix,
                               CanonicalizationMethod.EXCLUSIVE);
    }

    ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
    StringBuffer prefixListAttr = new StringBuffer("");
    @SuppressWarnings("unchecked")
    List<String> prefixList = params.getPrefixList();
    for (int i = 0, size = prefixList.size(); i < size; i++) {
        prefixListAttr.append(prefixList.get(i));
        if (i < size - 1) {
            prefixListAttr.append(" ");
        }
    }
    DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
    this.inclusiveNamespaces = prefixListAttr.toString();
    transformElem.appendChild(eElem);
}
项目:openjdk-jdk7u-jdk    文件:DOMExcC14NMethod.java   
public void init(TransformParameterSpec params)
    throws InvalidAlgorithmParameterException {
    if (params != null) {
        if (!(params instanceof ExcC14NParameterSpec)) {
            throw new InvalidAlgorithmParameterException
                ("params must be of type ExcC14NParameterSpec");
        }
        this.params = (C14NMethodParameterSpec) params;
    }
}