当前位置: 首页>>代码示例>>Java>>正文


Java Crypto.getX509Certificates方法代码示例

本文整理汇总了Java中org.apache.ws.security.components.crypto.Crypto.getX509Certificates方法的典型用法代码示例。如果您正苦于以下问题:Java Crypto.getX509Certificates方法的具体用法?Java Crypto.getX509Certificates怎么用?Java Crypto.getX509Certificates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ws.security.components.crypto.Crypto的用法示例。


在下文中一共展示了Crypto.getX509Certificates方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createKeyInfo

import org.apache.ws.security.components.crypto.Crypto; //导入方法依赖的package包/类
protected KeyInfoBean createKeyInfo() throws Exception
{
   InputStream is = Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties").openStream();
   Properties props = new Properties();
   try
   {
      props.load(is);
   }
   finally
   {
      is.close();
   }
   Crypto crypto = CryptoFactory.getInstance(props);
   CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
   cryptoType.setAlias("alice");
   X509Certificate[] certs = crypto.getX509Certificates(cryptoType);

   KeyInfoBean keyInfo = new KeyInfoBean();
   keyInfo.setCertificate(certs[0]);
   keyInfo.setCertIdentifer(CERT_IDENTIFIER.X509_CERT);

   return keyInfo;
}
 
开发者ID:rareddy,项目名称:ws-security-examples,代码行数:24,代码来源:SamlCallbackHandler.java

示例2: createKeyInfo

import org.apache.ws.security.components.crypto.Crypto; //导入方法依赖的package包/类
protected KeyInfoBean createKeyInfo() throws Exception
{
    InputStream is = Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties").openStream();
    Properties props = new Properties();
    try
    {
        props.load(is);
    }
    finally
    {
        is.close();
    }
    Crypto crypto = CryptoFactory.getInstance(props);
    CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
    cryptoType.setAlias("alice");
    X509Certificate[] certs = crypto.getX509Certificates(cryptoType);

    KeyInfoBean keyInfo = new KeyInfoBean();
    keyInfo.setCertificate(certs[0]);
    keyInfo.setCertIdentifer(CERT_IDENTIFIER.X509_CERT);

    return keyInfo;
}
 
开发者ID:windup,项目名称:windup-rulesets,代码行数:24,代码来源:SamlCallbackHandler.java

示例3: SAML2CallbackHandler

import org.apache.ws.security.components.crypto.Crypto; //导入方法依赖的package包/类
public SAML2CallbackHandler(Crypto crypto, String alias) throws Exception {
    if (certs == null) {
        CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
        cryptoType.setAlias(alias);
        certs = crypto.getX509Certificates(cryptoType);
    }
    
    subjectName = "uid=joe,ou=people,ou=saml-demo,o=example.com";
    subjectQualifier = "www.example.com";
    confirmationMethod = SAML2Constants.CONF_HOLDER_KEY;
}
 
开发者ID:jaminh,项目名称:spring-saml-example-war,代码行数:12,代码来源:SAML2CallbackHandler.java

示例4: getX509Certificates

import org.apache.ws.security.components.crypto.Crypto; //导入方法依赖的package包/类
/**
 * get the X509Certificate array.
 *
 * @param reverse
 * @param crypto
 * @return array of certificates 
 * @throws WSSecurityException
 */
public X509Certificate[] getX509Certificates(boolean reverse, Crypto crypto)
    throws WSSecurityException {
    byte[] data = getToken();
    if (data == null) {
        return null;
    }
    return crypto.getX509Certificates(data, reverse);
}
 
开发者ID:wso2,项目名称:wso2-wss4j,代码行数:17,代码来源:PKIPathSecurity.java


注:本文中的org.apache.ws.security.components.crypto.Crypto.getX509Certificates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。