• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RecipientInfoGenerator类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.bouncycastle.cms.RecipientInfoGenerator的典型用法代码示例。如果您正苦于以下问题:Java RecipientInfoGenerator类的具体用法?Java RecipientInfoGenerator怎么用?Java RecipientInfoGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

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

示例1: testHeaders

点赞 3

import org.bouncycastle.cms.RecipientInfoGenerator; //导入依赖的package包/类
@Test
public void testHeaders()
        throws Exception {
    InternetHeaders ih = new InternetHeaders();
    ih.addHeader("Content-Type", "application/xml");

    MimeBodyPart _msg = new MimeBodyPart(ih, "<customer name=\"bill\"/>".getBytes());


    SMIMEEnvelopedGenerator gen = new SMIMEEnvelopedGenerator();
    OutputEncryptor encryptor = new JceCMSContentEncryptorBuilder(CMSAlgorithm.DES_EDE3_CBC)
            .setProvider("BC")
            .build();

    RecipientInfoGenerator generator = new JceKeyTransRecipientInfoGenerator(cert);
    gen.addRecipientInfoGenerator(generator);

    //
    // generate a MimeBodyPart object which encapsulates the content
    // we want encrypted.
    //

    MimeBodyPart mp = gen.generate(_msg, encryptor);

    output(mp);
}
 

开发者ID:gini,
项目名称:jersey-smime,
代码行数:27,
代码来源:EnvelopedTest.java

示例2: addRecipientGenerator

点赞 2

import org.bouncycastle.cms.RecipientInfoGenerator; //导入依赖的package包/类
/**
 * Add a recipient generator to this control.
 *
 * @param recipientGen recipient generator created for a specific recipient.
 * @return this builder object.
 */
public PKIArchiveControlBuilder addRecipientGenerator(RecipientInfoGenerator recipientGen)
{
    envGen.addRecipientInfoGenerator(recipientGen);

    return this;
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:13,
代码来源:PKIArchiveControlBuilder.java

示例3: addRecipientInfoGenerator

点赞 2

import org.bouncycastle.cms.RecipientInfoGenerator; //导入依赖的package包/类
/**
 * add a recipientInfoGenerator.
 */
public void addRecipientInfoGenerator(
    RecipientInfoGenerator recipientInfoGen)
    throws IllegalArgumentException
{
    fact.addRecipientInfoGenerator(recipientInfoGen);
}
 

开发者ID:credentials,
项目名称:irma_future_id,
代码行数:10,
代码来源:SMIMEEnvelopedGenerator.java

示例4: ContentEncryptor

点赞 2

import org.bouncycastle.cms.RecipientInfoGenerator; //导入依赖的package包/类
ContentEncryptor(
    MimeBodyPart content,
    ASN1ObjectIdentifier       encryptionOid,
    int          keySize,
    Provider     provider)
    throws CMSException
{
    _content = content;

    if (keySize == 0)  // use the default
    {
        _encryptor = new JceCMSContentEncryptorBuilder(encryptionOid).setProvider(provider).build();
    }
    else
    {
        _encryptor = new JceCMSContentEncryptorBuilder(encryptionOid, keySize).setProvider(provider).build();
    }

    if (provider != null)
    {
        for (Iterator it = recipients.iterator(); it.hasNext();)
        {
            RecipientInfoGenerator rd = (RecipientInfoGenerator)it.next();

            if (rd instanceof JceKeyTransRecipientInfoGenerator)
            {
                ((JceKeyTransRecipientInfoGenerator)rd).setProvider(provider);
            }
            else if (rd instanceof JceKEKRecipientInfoGenerator)
            {
                ((JceKEKRecipientInfoGenerator)rd).setProvider(provider);
            }
        }
    }
}
 

开发者ID:credentials,
项目名称:irma_future_id,
代码行数:36,
代码来源:SMIMEEnvelopedGenerator.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)