Java 类org.bouncycastle.asn1.pkcs.AuthenticatedSafe 实例源码

项目:ipack    文件:PKCS12PfxPduBuilder.java   
/**
 * Build the Pfx structure, protecting it with a MAC calculated against the passed in password.
 *
 * @param macCalcBuilder a builder for a PKCS12 mac calculator.
 * @param password the password to use.
 * @return a Pfx object.
 * @throws PKCSException on a encoding or processing error.
 */
public PKCS12PfxPdu build(PKCS12MacCalculatorBuilder macCalcBuilder, char[] password)
    throws PKCSException
{
    AuthenticatedSafe auth = AuthenticatedSafe.getInstance(new DLSequence(dataVector));
    byte[]            encAuth;

    try
    {
        encAuth = auth.getEncoded();
    }
    catch (IOException e)
    {
        throw new PKCSException("unable to encode AuthenticatedSafe: " + e.getMessage(), e);
    }

    ContentInfo       mainInfo = new ContentInfo(PKCSObjectIdentifiers.data, new DEROctetString(encAuth));
    MacData           mData = null;

    if (macCalcBuilder != null)
    {
        MacDataGenerator mdGen = new MacDataGenerator(macCalcBuilder);

        mData = mdGen.build(password, encAuth);
    }

    //
    // output the Pfx
    //
    Pfx pfx = new Pfx(mainInfo, mData);

    return new PKCS12PfxPdu(pfx);
}
项目:gwt-crypto    文件:PKCS12PfxPduBuilder.java   
/**
 * Build the Pfx structure, protecting it with a MAC calculated against the passed in password.
 *
 * @param macCalcBuilder a builder for a PKCS12 mac calculator.
 * @param password the password to use.
 * @return a Pfx object.
 * @throws PKCSException on a encoding or processing error.
 */
public PKCS12PfxPdu build(PKCS12MacCalculatorBuilder macCalcBuilder, char[] password)
    throws PKCSException
{
    AuthenticatedSafe auth = AuthenticatedSafe.getInstance(new DLSequence(dataVector));
    byte[]            encAuth;

    try
    {
        encAuth = auth.getEncoded();
    }
    catch (IOException e)
    {
        throw new PKCSException("unable to encode AuthenticatedSafe: " + e.getMessage(), e);
    }

    ContentInfo       mainInfo = new ContentInfo(PKCSObjectIdentifiers.data, new DEROctetString(encAuth));
    MacData           mData = null;

    if (macCalcBuilder != null)
    {
        MacDataGenerator mdGen = new MacDataGenerator(macCalcBuilder);

        mData = mdGen.build(password, encAuth);
    }

    //
    // output the Pfx
    //
    Pfx pfx = new Pfx(mainInfo, mData);

    return new PKCS12PfxPdu(pfx);
}
项目:Aki-SSL    文件:PKCS12PfxPduBuilder.java   
/**
 * Build the Pfx structure, protecting it with a MAC calculated against the passed in password.
 *
 * @param macCalcBuilder a builder for a PKCS12 mac calculator.
 * @param password the password to use.
 * @return a Pfx object.
 * @throws PKCSException on a encoding or processing error.
 */
public PKCS12PfxPdu build(PKCS12MacCalculatorBuilder macCalcBuilder, char[] password)
    throws PKCSException
{
    AuthenticatedSafe auth = AuthenticatedSafe.getInstance(new DLSequence(dataVector));
    byte[]            encAuth;

    try
    {
        encAuth = auth.getEncoded();
    }
    catch (IOException e)
    {
        throw new PKCSException("unable to encode AuthenticatedSafe: " + e.getMessage(), e);
    }

    ContentInfo       mainInfo = new ContentInfo(PKCSObjectIdentifiers.data, new DEROctetString(encAuth));
    MacData           mData = null;

    if (macCalcBuilder != null)
    {
        MacDataGenerator mdGen = new MacDataGenerator(macCalcBuilder);

        mData = mdGen.build(password, encAuth);
    }

    //
    // output the Pfx
    //
    Pfx pfx = new Pfx(mainInfo, mData);

    return new PKCS12PfxPdu(pfx);
}
项目:irma_future_id    文件:PKCS12PfxPduBuilder.java   
/**
 * Build the Pfx structure, protecting it with a MAC calculated against the passed in password.
 *
 * @param macCalcBuilder a builder for a PKCS12 mac calculator.
 * @param password the password to use.
 * @return a Pfx object.
 * @throws PKCSException on a encoding or processing error.
 */
public PKCS12PfxPdu build(PKCS12MacCalculatorBuilder macCalcBuilder, char[] password)
    throws PKCSException
{
    AuthenticatedSafe auth = AuthenticatedSafe.getInstance(new DLSequence(dataVector));
    byte[]            encAuth;

    try
    {
        encAuth = auth.getEncoded();
    }
    catch (IOException e)
    {
        throw new PKCSException("unable to encode AuthenticatedSafe: " + e.getMessage(), e);
    }

    ContentInfo       mainInfo = new ContentInfo(PKCSObjectIdentifiers.data, new DEROctetString(encAuth));
    MacData           mData = null;

    if (macCalcBuilder != null)
    {
        MacDataGenerator mdGen = new MacDataGenerator(macCalcBuilder);

        mData = mdGen.build(password, encAuth);
    }

    //
    // output the Pfx
    //
    Pfx pfx = new Pfx(mainInfo, mData);

    return new PKCS12PfxPdu(pfx);
}
项目:bc-java    文件:PKCS12PfxPduBuilder.java   
/**
 * Build the Pfx structure, protecting it with a MAC calculated against the passed in password.
 *
 * @param macCalcBuilder a builder for a PKCS12 mac calculator.
 * @param password the password to use.
 * @return a Pfx object.
 * @throws PKCSException on a encoding or processing error.
 */
public PKCS12PfxPdu build(PKCS12MacCalculatorBuilder macCalcBuilder, char[] password)
    throws PKCSException
{
    AuthenticatedSafe auth = AuthenticatedSafe.getInstance(new DLSequence(dataVector));
    byte[]            encAuth;

    try
    {
        encAuth = auth.getEncoded();
    }
    catch (IOException e)
    {
        throw new PKCSException("unable to encode AuthenticatedSafe: " + e.getMessage(), e);
    }

    ContentInfo       mainInfo = new ContentInfo(PKCSObjectIdentifiers.data, new DEROctetString(encAuth));
    MacData           mData = null;

    if (macCalcBuilder != null)
    {
        MacDataGenerator mdGen = new MacDataGenerator(macCalcBuilder);

        mData = mdGen.build(password, encAuth);
    }

    //
    // output the Pfx
    //
    Pfx pfx = new Pfx(mainInfo, mData);

    return new PKCS12PfxPdu(pfx);
}