All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.spongycastle.jce.spec.IESParameterSpec Maven / Gradle / Ivy

Go to download

Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle intended for Android. Android ships with a stripped-down version of Bouncy Castle - this causes classloader collisions if you try to add an alternative (updated/complete) Bouncy Castle jar. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.5.

There is a newer version: 1.46.99.3-UNOFFICIAL-ROBERTO-RELEASE
Show newest version
package org.spongycastle.jce.spec;

import java.security.spec.AlgorithmParameterSpec;

/**
 * Parameter spec for an integrated encryptor, as in IEEE P1363a
 */
public class IESParameterSpec
    implements AlgorithmParameterSpec
{
    private byte[]  derivation;
    private byte[]  encoding;
    private int     macKeySize;

    public IESParameterSpec(
        byte[]  derivation,
        byte[]  encoding,
        int     macKeySize)
    {
        this.derivation = new byte[derivation.length];
        System.arraycopy(derivation, 0, this.derivation, 0, derivation.length);

        this.encoding = new byte[encoding.length];
        System.arraycopy(encoding, 0, this.encoding, 0, encoding.length);

        this.macKeySize = macKeySize;           
    }

    /**
     * return the derivation vector.
     */
    public byte[] getDerivationV()
    {
        return derivation;
    }

    /**
     * return the encoding vector.
     */
    public byte[] getEncodingV()
    {
        return encoding;
    }

    /**
     * return the key size in bits for the MAC used with the message
     */
    public int getMacKeySize()
    {
        return macKeySize;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy