![JAR search and dependency download from the Maven repository](/logo.png)
org.bouncycastle.crypto.internal.pqc.ExchangePair 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.
/***************************************************************/
/****** DO NOT EDIT THIS CLASS bc-java SOURCE FILE ******/
/***************************************************************/
package org.bouncycastle.crypto.internal.pqc;
import org.bouncycastle.crypto.internal.params.AsymmetricKeyParameter;
import org.bouncycastle.util.Arrays;
/**
* Pair for a value exchange algorithm where the responding party has no private key, such as NewHope.
*/
public class ExchangePair
{
private final AsymmetricKeyParameter publicKey;
private final byte[] shared;
/**
* Base constructor.
*
* @param publicKey The responding party's public key.
* @param shared the calculated shared value.
*/
public ExchangePair(AsymmetricKeyParameter publicKey, byte[] shared)
{
this.publicKey = publicKey;
this.shared = Arrays.clone(shared);
}
/**
* Return the responding party's public key.
*
* @return the public key calculated for the exchange.
*/
public AsymmetricKeyParameter getPublicKey()
{
return publicKey;
}
/**
* Return the shared value calculated with public key.
*
* @return the shared value.
*/
public byte[] getSharedValue()
{
return Arrays.clone(shared);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy