Package javax.xml.crypto.dsig.keyinfo

Examples of javax.xml.crypto.dsig.keyinfo.X509Data


  }

        if (!(o instanceof X509Data)) {
            return false;
  }
        X509Data oxd = (X509Data) o;

  List ocontent = oxd.getContent();
  int size = content.size();
  if (size != ocontent.size()) {
      return false;
  }
View Full Code Here


        KeyInfoFactory kif = signFactory.getKeyInfoFactory();
        List<Object> x509Content = new ArrayList<Object>();
        x509Content.add(cert.getSubjectX500Principal().getName());
        x509Content.add(cert);
        X509Data xd = kif.newX509Data(x509Content);
        return kif.newKeyInfo(Collections.singletonList(xd));
    }
View Full Code Here

        KeyInfoFactory kif = signFactory.getKeyInfoFactory();
        List<Object> x509Content = new ArrayList<Object>();
        x509Content.add(cert.getSubjectX500Principal().getName());
        x509Content.add(cert);
        X509Data xd = kif.newX509Data(x509Content);
        return kif.newKeyInfo(Collections.singletonList(xd));
    }
View Full Code Here

    private static KeyInfo generateKeyInfo(Certificate[] chain, XmlSignatureAppearance sap) {
        Certificate certificate = chain[0];
        sap.setCertificate(certificate);
        KeyInfoFactory kif = new DOMKeyInfoFactory();
        // Create an X509Data containing the X.509 certificate
        X509Data x509d = kif.newX509Data(Collections.singletonList(certificate));
        // Create a KeyInfo and add the KeyValue to it
        return kif.newKeyInfo(Collections.singletonList(x509d));
    }
View Full Code Here

        // Create the KeyInfo containing the X509Data.
        KeyInfoFactory kif = fac.getKeyInfoFactory();
        List<Object> x509Content = new ArrayList<Object>();
        x509Content.add(cert.getSubjectX500Principal().getName());
        x509Content.add(cert);
        X509Data xd = kif.newX509Data(x509Content);
        KeyInfo ki = kif.newKeyInfo(Collections.singletonList(xd));

        // Create a DOMSignContext and specify the RSA PrivateKey and
        // location of the resulting XMLSignature's parent element.
        DOMSignContext dsc = new DOMSignContext(privateKey, node);
View Full Code Here

        // Create the KeyInfo containing the X509Data.
        KeyInfoFactory kif = fac.getKeyInfoFactory();
        List<Object> x509Content = new ArrayList<Object>();
        //x509Content.add(cert.getSubjectX500Principal().getName());
        x509Content.add(cert);
        X509Data xd = kif.newX509Data(x509Content);
        KeyInfo ki = kif.newKeyInfo(Collections.singletonList(xd));

        // Create a DOMSignContext and specify the RSA PrivateKey and
        // location of the resulting XMLSignature's parent element.
        DOMSignContext dsc = new DOMSignContext(privateKey, node);
View Full Code Here

                        x509Content = new ArrayList<Object>();

                        x509Content.add(cert.getSubjectDN().getName());
            //  x509Content.add(cert);
                        //x509Content.add(cert.getSubjectDN().getName());
                        X509Data xd = kif.newX509Data(x509Content);
                        data.add(xd);
                }

        //  if (map.containsKey(SIGNATURE_OPTION_CERT_INCLUSION_X500_PRINICPAL)) {
                // }
                if (map.containsKey(SIGNATURE_OPTION_CERT_INCLUSION_BASE64)) {
                        x509Content = new ArrayList<Object>();
                        x509Content.add(cert);
                        //x509Content.add(cert.getSubjectX500Principal().getName());
                        X509Data xd = kif.newX509Data(x509Content);
                        data.add(xd);
                }
                if (map.containsKey(SIGNATURE_OPTION_CERT_INCLUSION_SERIAL)) {
                        x509Content = new ArrayList<Object>();

                        X509IssuerSerial issuer = kif.newX509IssuerSerial(cert.getIssuerX500Principal().getName(), cert.getSerialNumber());

                        x509Content.add(issuer);
                        X509Data xd = kif.newX509Data(x509Content);
                        data.add(xd);
                }

        // 
                //x509Content.add(cert);
View Full Code Here

        }

        if (!(o instanceof X509Data)) {
            return false;
        }
        X509Data oxd = (X509Data)o;

        @SuppressWarnings("unchecked") List<Object> ocontent = oxd.getContent();
        int size = content.size();
        if (size != ocontent.size()) {
            return false;
        }
View Full Code Here

        }

        if (!(o instanceof X509Data)) {
            return false;
        }
        X509Data oxd = (X509Data)o;

        @SuppressWarnings("unchecked") List<Object> ocontent = oxd.getContent();
        int size = content.size();
        if (size != ocontent.size()) {
            return false;
        }
View Full Code Here

                } else if (list.get(i) instanceof X509Certificate) {
                    ReceivedKey receivedKey = new ReceivedKey();
                    receivedKey.setX509Cert((X509Certificate)list.get(i));
                    return receivedKey;
                } else if (list.get(i) instanceof X509Data) {
                    X509Data x509Data = (X509Data)list.get(i);
                    for (int j = 0; j < x509Data.getContent().size(); j++) {
                        if (x509Data.getContent().get(j) instanceof X509Certificate) {
                            ReceivedKey receivedKey = new ReceivedKey();
                            receivedKey.setX509Cert((X509Certificate)x509Data.getContent().get(j));
                            return receivedKey;
                        }
                    }
                }
            }
View Full Code Here

TOP

Related Classes of javax.xml.crypto.dsig.keyinfo.X509Data

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.