javax.xml.crypto.dsig.spec.ExcC14NParameterSpec Java Examples

The following examples show how to use javax.xml.crypto.dsig.spec.ExcC14NParameterSpec. 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 File: DOMExcC14NMethod.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #2
Source File: DOMExcC14NMethod.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #3
Source File: DOMExcC14NMethod.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #4
Source File: DOMExcC14NMethod.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #5
Source File: DOMExcC14NMethod.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #6
Source File: DOMExcC14NMethod.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #7
Source File: DOMExcC14NMethod.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #8
Source File: DOMExcC14NMethod.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #9
Source File: DOMExcC14NMethod.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #10
Source File: DOMExcC14NMethod.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #11
Source File: DOMExcC14NMethod.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #12
Source File: DOMExcC14NMethod.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #13
Source File: DOMExcC14NMethod.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example #14
Source File: DOMExcC14NMethod.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}
 
Example #15
Source File: DOMExcC14NMethod.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #16
Source File: DOMExcC14NMethod.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}
 
Example #17
Source File: DOMExcC14NMethod.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}
 
Example #18
Source File: DOMExcC14NMethod.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #19
Source File: DOMExcC14NMethod.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #20
Source File: DOMExcC14NMethod.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}
 
Example #21
Source File: DOMExcC14NMethod.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #22
Source File: DOMExcC14NMethod.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}
 
Example #23
Source File: DOMExcC14NMethod.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}
 
Example #24
Source File: DOMExcC14NMethod.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #25
Source File: DOMExcC14NMethod.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}
 
Example #26
Source File: DOMExcC14NMethod.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #27
Source File: DOMExcC14NMethod.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #28
Source File: DOMExcC14NMethod.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #29
Source File: DOMExcC14NMethod.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}
 
Example #30
Source File: DOMExcC14NMethod.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
}