📄 x9privatekeyinfo.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: X9PrivateKeyInfo.java
package jit.asn1.x9;
import jit.asn1.*;
import jit.crypto.params.ECDomainParameters;
import jit.crypto.params.ECPrivateKeyParameters;
import jit.math.BigInteger;
// Referenced classes of package jit.asn1.x9:
// X9ECParameters
public class X9PrivateKeyInfo
implements DEREncodable
{
private DERInteger version;
private DEROctetString privateKey;
private X9ECParameters domainParams;
public X9PrivateKeyInfo()
{
version = new DERInteger(1);
privateKey = null;
domainParams = null;
}
public X9PrivateKeyInfo(DERInteger version, DEROctetString privateKey, X9ECParameters domainParams)
{
this.version = new DERInteger(1);
if(version != null)
this.version = version;
this.privateKey = privateKey;
this.domainParams = domainParams;
}
public X9PrivateKeyInfo(DEROctetString privateKey, X9ECParameters domainParams)
{
version = new DERInteger(1);
this.privateKey = privateKey;
this.domainParams = domainParams;
}
public X9PrivateKeyInfo(DERInteger version, DEROctetString privateKey)
{
this.version = new DERInteger(1);
if(version != null)
this.version = version;
this.privateKey = privateKey;
domainParams = null;
}
public X9PrivateKeyInfo(ASN1Sequence seq)
{
version = new DERInteger(1);
if(!((DERInteger)seq.getObjectAt(0)).equals(version))
{
throw new IllegalArgumentException("unknown object in creating object");
} else
{
privateKey = (DEROctetString)seq.getObjectAt(1);
DERTaggedObject tTaggedObject = (DERTaggedObject)seq.getObjectAt(2);
DERSequence tDERSequence = new DERSequence(tTaggedObject.getObject());
ASN1Sequence tASN1Sequence = (ASN1Sequence)tDERSequence.getObjectAt(0);
domainParams = new X9ECParameters(tASN1Sequence);
return;
}
}
public ECDomainParameters getECDomainParameters()
{
return new ECDomainParameters(domainParams.getCurve(), domainParams.getG(), domainParams.getN(), domainParams.getH(), domainParams.getSeed());
}
public X9ECParameters getDomainParams()
{
return domainParams;
}
public ECPrivateKeyParameters getPrivateKey()
{
byte tByteKey[] = privateKey.getOctets();
BigInteger d = new BigInteger(tByteKey);
ECPrivateKeyParameters tECKey = new ECPrivateKeyParameters(d, getECDomainParameters());
return tECKey;
}
public DERInteger getVersion()
{
return version;
}
public DERObject getDERObject()
{
ASN1EncodableVector v = new ASN1EncodableVector();
DERTaggedObject asn1Tag = new DERTaggedObject(true, 0, domainParams);
v.add(version);
v.add(privateKey);
v.add(asn1Tag);
return new DERSequence(v);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -