![JAR search and dependency download from the Maven repository](/logo.png)
org.bouncycastle.jcajce.spec.UserKeyingMaterialSpec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bc-fips-debug Show documentation
Show all versions of bc-fips-debug Show documentation
The FIPS 140-2 Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms certified to FIPS 140-2 level 1. This jar contains the debug version JCE provider and low-level API for the BC-FJA version 1.0.2.3, FIPS Certificate #3514. Please note the debug jar is not certified.
package org.bouncycastle.jcajce.spec;
import java.security.spec.AlgorithmParameterSpec;
import org.bouncycastle.util.Arrays;
/**
* User keying material for the KDF used in key agreement algorithms.
*/
public class UserKeyingMaterialSpec
implements AlgorithmParameterSpec
{
private final byte[] userKeyingMaterial;
private final byte[] salt;
/**
* Base constructor.
*
* @param userKeyingMaterial the bytes to be mixed in to the key agreement's KDF.
*/
public UserKeyingMaterialSpec(byte[] userKeyingMaterial)
{
this(userKeyingMaterial, null);
}
/**
* Base constructor.
*
* @param userKeyingMaterial the bytes to be mixed in to the key agreement's KDF.
* @param salt the salt to use with the underlying KDF.
*/
public UserKeyingMaterialSpec(byte[] userKeyingMaterial, byte[] salt)
{
this.userKeyingMaterial = Arrays.clone(userKeyingMaterial);
this.salt = Arrays.clone(salt);
}
/**
* Return a copy of the key material in this object.
*
* @return the user keying material.
*/
public byte[] getUserKeyingMaterial()
{
return Arrays.clone(userKeyingMaterial);
}
/**
* Return a copy of the salt in this object.
*
* @return the KDF salt.
*/
public byte[] getSalt()
{
return Arrays.clone(salt);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy