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

org.bouncycastle.jcajce.provider.GOST3410Util Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 2.0.0
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy