• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java GOST3410PublicKeyParameterSetSpec类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec的典型用法代码示例。如果您正苦于以下问题:Java GOST3410PublicKeyParameterSetSpec类的具体用法?Java GOST3410PublicKeyParameterSetSpec怎么用?Java GOST3410PublicKeyParameterSetSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

GOST3410PublicKeyParameterSetSpec类属于org.bouncycastle.jce.spec包,在下文中一共展示了GOST3410PublicKeyParameterSetSpec类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readObject

点赞 3

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
private void readObject(
    ObjectInputStream in)
    throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    String publicKeyParamSetOID = (String)in.readObject();
    if (publicKeyParamSetOID != null)
    {
        this.gost3410Spec = new GOST3410ParameterSpec(publicKeyParamSetOID, (String)in.readObject(), (String)in.readObject());
    }
    else
    {
        this.gost3410Spec = new GOST3410ParameterSpec(new GOST3410PublicKeyParameterSetSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()));
        in.readObject();
        in.readObject();
    }
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:19,
代码来源:BCGOST3410PublicKey.java

示例2: readObject

点赞 3

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
private void readObject(
    ObjectInputStream in)
    throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    String publicKeyParamSetOID = (String)in.readObject();
    if (publicKeyParamSetOID != null)
    {
        this.gost3410Spec = new GOST3410ParameterSpec(publicKeyParamSetOID, (String)in.readObject(), (String)in.readObject());
    }
    else
    {
        this.gost3410Spec = new GOST3410ParameterSpec(new GOST3410PublicKeyParameterSetSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()));
        in.readObject();
        in.readObject();
    }
    this.attrCarrier = new PKCS12BagAttributeCarrierImpl();
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:20,
代码来源:BCGOST3410PrivateKey.java

示例3: localEngineGetParameterSpec

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
protected AlgorithmParameterSpec localEngineGetParameterSpec(
    Class paramSpec)
    throws InvalidParameterSpecException
{
    if (paramSpec == GOST3410PublicKeyParameterSetSpec.class)
    {
        return currentSpec;
    }

    throw new InvalidParameterSpecException("unknown parameter spec passed to GOST3410 parameters object.");
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:12,
代码来源:AlgorithmParametersSpi.java

示例4: engineGenerateParameters

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
protected AlgorithmParameters engineGenerateParameters()
{
    GOST3410ParametersGenerator pGen = new GOST3410ParametersGenerator();

    if (random != null)
    {
        pGen.init(strength, 2, random);
    }
    else
    {
        pGen.init(strength, 2, new SecureRandom());
    }

    GOST3410Parameters p = pGen.generateParameters();

    AlgorithmParameters params;

    try
    {
        params = AlgorithmParameters.getInstance("GOST3410", BouncyCastleProvider.PROVIDER_NAME);
        params.init(new GOST3410ParameterSpec(new GOST3410PublicKeyParameterSetSpec(p.getP(), p.getQ(), p.getA())));
    }
    catch (Exception e)
    {
        throw new RuntimeException(e.getMessage());
    }

    return params;
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:30,
代码来源:AlgorithmParameterGeneratorSpi.java

示例5: init

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
private void init(
    GOST3410ParameterSpec gParams,
    SecureRandom random)
{
    GOST3410PublicKeyParameterSetSpec spec = gParams.getPublicKeyParameters();

    param = new GOST3410KeyGenerationParameters(random, new GOST3410Parameters(spec.getP(), spec.getQ(), spec.getA()));

    engine.init(param);

    initialised = true;
    gost3410Params = gParams;
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:14,
代码来源:KeyPairGeneratorSpi.java

示例6: generatePublicKeyParameter

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
static public AsymmetricKeyParameter generatePublicKeyParameter(
    PublicKey    key)
    throws InvalidKeyException
{
    if (key instanceof GOST3410PublicKey)
    {
        GOST3410PublicKey          k = (GOST3410PublicKey)key;
        GOST3410PublicKeyParameterSetSpec p = k.getParameters().getPublicKeyParameters();
        
        return new GOST3410PublicKeyParameters(k.getY(),
            new GOST3410Parameters(p.getP(), p.getQ(), p.getA()));
    }

    throw new InvalidKeyException("can't identify GOST3410 public key: " + key.getClass().getName());
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:16,
代码来源:GOST3410Util.java

示例7: generatePrivateKeyParameter

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
static public AsymmetricKeyParameter generatePrivateKeyParameter(
    PrivateKey    key)
    throws InvalidKeyException
{
    if (key instanceof GOST3410PrivateKey)
    {
        GOST3410PrivateKey         k = (GOST3410PrivateKey)key;
        GOST3410PublicKeyParameterSetSpec p = k.getParameters().getPublicKeyParameters();
        
        return new GOST3410PrivateKeyParameters(k.getX(),
            new GOST3410Parameters(p.getP(), p.getQ(), p.getA()));
    }

    throw new InvalidKeyException("can't identify GOST3410 private key.");
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:16,
代码来源:GOST3410Util.java

示例8: localEngineGetParameterSpec

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
protected AlgorithmParameterSpec localEngineGetParameterSpec(
    Class paramSpec)
    throws InvalidParameterSpecException
{
    if (paramSpec == GOST3410PublicKeyParameterSetSpec.class || paramSpec == AlgorithmParameterSpec.class)
    {
        return currentSpec;
    }

    throw new InvalidParameterSpecException("unknown parameter spec passed to GOST3410 parameters object.");
}
 

开发者ID:thedrummeraki,
项目名称:Aki-SSL,
代码行数:12,
代码来源:AlgorithmParametersSpi.java

示例9: engineGenerateParameters

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
protected AlgorithmParameters engineGenerateParameters()
{
    GOST3410ParametersGenerator pGen = new GOST3410ParametersGenerator();

    if (random != null)
    {
        pGen.init(strength, 2, random);
    }
    else
    {
        pGen.init(strength, 2, new SecureRandom());
    }

    GOST3410Parameters p = pGen.generateParameters();

    AlgorithmParameters params;

    try
    {
        params = createParametersInstance("GOST3410");
        params.init(new GOST3410ParameterSpec(new GOST3410PublicKeyParameterSetSpec(p.getP(), p.getQ(), p.getA())));
    }
    catch (Exception e)
    {
        throw new RuntimeException(e.getMessage());
    }

    return params;
}
 

开发者ID:thedrummeraki,
项目名称:Aki-SSL,
代码行数:30,
代码来源:AlgorithmParameterGeneratorSpi.java

示例10: BCGOST3410PublicKey

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
BCGOST3410PublicKey(
    GOST3410PublicKeySpec spec)
{
    this.y = spec.getY();
    this.gost3410Spec = new GOST3410ParameterSpec(new GOST3410PublicKeyParameterSetSpec(spec.getP(), spec.getQ(), spec.getA()));
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:7,
代码来源:BCGOST3410PublicKey.java

示例11: BCGOST3410PrivateKey

点赞 2

import org.bouncycastle.jce.spec.GOST3410PublicKeyParameterSetSpec; //导入依赖的package包/类
BCGOST3410PrivateKey(
    GOST3410PrivateKeySpec spec)
{
    this.x = spec.getX();
    this.gost3410Spec = new GOST3410ParameterSpec(new GOST3410PublicKeyParameterSetSpec(spec.getP(), spec.getQ(), spec.getA()));
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:7,
代码来源:BCGOST3410PrivateKey.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)