org.bouncycastle.jcajce.provider.GOST3410Util Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bc-fips Show documentation
Show all versions of bc-fips Show documentation
The FIPS 140-3 Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms certified to FIPS 140-3 level 1. This jar contains JCE provider and low-level API for the BC-FJA version 2.0.0, FIPS Certificate #4743. Please see certificate for certified platform details.
package org.bouncycastle.jcajce.provider;
import org.bouncycastle.crypto.asymmetric.ECDomainParameters;
import org.bouncycastle.crypto.asymmetric.GOST3410DomainParameters;
import org.bouncycastle.crypto.asymmetric.GOST3410Parameters;
import org.bouncycastle.jcajce.spec.ECDomainParameterSpec;
import org.bouncycastle.jcajce.spec.GOST3410DomainParameterSpec;
import org.bouncycastle.jcajce.spec.GOST3410ParameterSpec;
class GOST3410Util
{
static GOST3410Parameters convertToParams(GOST3410ParameterSpec params)
{
GOST3410DomainParameterSpec domainSpec = params.getDomainParametersSpec();
return new GOST3410Parameters(params.getPublicKeyParamSet(), params.getDigestParamSet(), params.getDigestParamSet(),
new GOST3410DomainParameters(domainSpec.getKeySize(), domainSpec.getP(), domainSpec.getQ(), domainSpec.getA()));
}
static GOST3410Parameters convertToECParams(GOST3410ParameterSpec params)
{
return new GOST3410Parameters(params.getPublicKeyParamSet(), params.getDigestParamSet(), params.getDigestParamSet(), ECUtil.convertFromSpec(params.getDomainParametersSpec()));
}
public static GOST3410ParameterSpec convertToECSpec(GOST3410Parameters parameters)
{
return new GOST3410ParameterSpec(parameters);
}
public static GOST3410ParameterSpec convertToSpec(GOST3410Parameters parameters)
{
return new GOST3410ParameterSpec(parameters);
}
}