gpt4 book ai didi

org.opensaml.xmlsec.signature.X509Data.getX509Certificates()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 15:07:05 31 4
gpt4 key购买 nike

本文整理了Java中org.opensaml.xmlsec.signature.X509Data.getX509Certificates()方法的一些代码示例,展示了X509Data.getX509Certificates()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X509Data.getX509Certificates()方法的具体详情如下:
包路径:org.opensaml.xmlsec.signature.X509Data
类名称:X509Data
方法名:getX509Certificates

X509Data.getX509Certificates介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

KeyInfo keyInfo=(KeyInfo)Configuration.getBuilderFactory().getBuilder(KeyInfo.DEFAULT_ELEMENT_NAME).buildObject(KeyInfo.DEFAULT_ELEMENT_NAME);
   X509Data data=(X509Data)Configuration.getBuilderFactory().getBuilder(X509Data.DEFAULT_ELEMENT_NAME).buildObject(X509Data.DEFAULT_ELEMENT_NAME);
   X509Certificate cert=(X509Certificate)Configuration.getBuilderFactory().getBuilder(X509Certificate.DEFAULT_ELEMENT_NAME).buildObject(X509Certificate.DEFAULT_ELEMENT_NAME);
   signature.setSigningCredential(signingCredential);
   value=org.apache.xml.security.utils.Base64.encode(signingCredential.getEntityCertificate().getEncoded());
   cert.setValue(value);
   data.getX509Certificates().add(cert);
   keyInfo.getX509Datas().add(data);
   signature.setKeyInfo(keyInfo);

代码示例来源:origin: org.opensaml/opensaml-saml-impl

xmlCertificates = data.getX509Certificates();
if (xmlCertificates == null || xmlCertificates.isEmpty()) {
  log.debug("X509Data contained no X509Certificate children, skipping certificate match");

代码示例来源:origin: spring-projects/spring-security-saml

protected List<SimpleKey> getKeyFromDescriptor(KeyDescriptor desc) {
  List<SimpleKey> result = new LinkedList<>();
  if (desc.getKeyInfo() == null) {
    return null;
  }
  KeyType type = desc.getUse() != null ? KeyType.valueOf(desc.getUse().name()) : KeyType.UNSPECIFIED;
  int index = 0;
  for (X509Data x509 : ofNullable(desc.getKeyInfo().getX509Datas()).orElse(emptyList())) {
    for (X509Certificate cert : ofNullable(x509.getX509Certificates()).orElse(emptyList())) {
      result.add(new SimpleKey(type.getTypeName() + "-" + (index++), null, cert.getValue(), null,
        type
      ));
    }
  }
  return result;
}

代码示例来源:origin: org.apache.syncope.ext.saml2sp/syncope-ext-saml2sp-logic

for (KeyDescriptor key : idpdescriptor.getKeyDescriptors()) {
  for (X509Data x509Data : key.getKeyInfo().getX509Datas()) {
    for (org.opensaml.xmlsec.signature.X509Certificate cert : x509Data.getX509Certificates()) {
      try (ByteArrayInputStream bais = new ByteArrayInputStream(
          Base64.getMimeDecoder().decode(cert.getValue()))) {

代码示例来源:origin: org.wso2.appserver/appserver-webapp-security

/**
 * Generates an XML Object representing a digital signature.
 *
 * @param signatureAlgorithm the algorithm used to compute the signature
 * @param credential         the signature signing credentials
 * @return an XML Object representing an enveloped or detached XML Digital Signature
 * @throws SSOException if an error occurs while getting the signature
 */
private static Signature setSignatureRaw(String signatureAlgorithm, X509Credential credential) throws SSOException {
  Signature signature = (Signature) buildXMLObject(Signature.DEFAULT_ELEMENT_NAME);
  signature.setSigningCredential(credential);
  signature.setSignatureAlgorithm(signatureAlgorithm);
  signature.setCanonicalizationAlgorithm(Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
  try {
    KeyInfo keyInfo = (KeyInfo) buildXMLObject(KeyInfo.DEFAULT_ELEMENT_NAME);
    X509Data data = (X509Data) buildXMLObject(X509Data.DEFAULT_ELEMENT_NAME);
    X509Certificate cert = (X509Certificate) buildXMLObject(X509Certificate.DEFAULT_ELEMENT_NAME);
    String value = org.apache.xml.security.utils.Base64.encode(credential.getEntityCertificate().getEncoded());
    cert.setValue(value);
    data.getX509Certificates().add(cert);
    keyInfo.getX509Datas().add(data);
    signature.setKeyInfo(keyInfo);
    return signature;
  } catch (CertificateEncodingException e) {
    throw new SSOException("Error getting certificate", e);
  }
}

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.saml2/org.wso2.carbon.identity.query.saml

String value = org.apache.xml.security.utils.Base64.encode(cred.getEntityCertificate().getEncoded());
cert.setValue(value);
data.getX509Certificates().add(cert);
keyInfo.getX509Datas().add(data);
signature.setKeyInfo(keyInfo);

代码示例来源:origin: codice/ddf

x509CertificateBuilder.buildObject(X509Certificate.DEFAULT_ELEMENT_NAME);
signingX509Certificate.setValue(signingCert);
signingX509Data.getX509Certificates().add(signingX509Certificate);
signingKeyInfo.getX509Datas().add(signingX509Data);
signingKeyDescriptor.setKeyInfo(signingKeyInfo);
  x509CertificateBuilder.buildObject(X509Certificate.DEFAULT_ELEMENT_NAME);
encX509Certificate.setValue(encryptionCert);
encX509Data.getX509Certificates().add(encX509Certificate);
encKeyInfo.getX509Datas().add(encX509Data);
encKeyDescriptor.setKeyInfo(encKeyInfo);

代码示例来源:origin: codice/ddf

x509CertificateBuilder.buildObject(X509Certificate.DEFAULT_ELEMENT_NAME);
signingX509Certificate.setValue(signingCert);
signingX509Data.getX509Certificates().add(signingX509Certificate);
signingKeyInfo.getX509Datas().add(signingX509Data);
signingKeyDescriptor.setKeyInfo(signingKeyInfo);
  x509CertificateBuilder.buildObject(X509Certificate.DEFAULT_ELEMENT_NAME);
encX509Certificate.setValue(encryptionCert);
encX509Data.getX509Certificates().add(encX509Certificate);
encKeyInfo.getX509Datas().add(encX509Data);
encKeyDescriptor.setKeyInfo(encKeyInfo);

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com