C# 클래스 BitSharper.EcKey

파일 보기 프로젝트 열기: TangibleCryptography/BitSharper 1 사용 예제들

공개 메소드들

메소드 설명
EcKey ( BigInteger privKey ) : System

Creates an ECKey given only the private key. This works because EC public keys are derivable from their private keys by doing a multiply with the generator value.

FromAsn1 ( byte asn1PrivKey ) : EcKey

Construct an ECKey from an ASN.1 encoded private key. These are produced by OpenSSL and stored by the BitCoin reference implementation in its wallet.

GetPrivKeyBytes ( ) : byte[]

Returns a 32 byte array containing the private key.

GetPrivateKeyEncoded ( NetworkParameters @params ) : DumpedPrivateKey

Exports the private key in the form used by the Satoshi client "dumpprivkey" and "importprivkey" commands. Use the DumpedPrivateKey.ToString method to get the string.

Sign ( byte input ) : byte[]

Calculates an ECDSA signature in DER format for the given input hash. Note that the input is expected to be 32 bytes long.

ToAddress ( NetworkParameters @params ) : Address

Returns the address that corresponds to the public part of this ECKey. Note that an address is derived from the RIPEMD-160 hash of the public key and is not the public key itself (which is too large to be convenient).

ToAsn1 ( ) : byte[]

Output this ECKey as an ASN.1 encoded private key, as understood by OpenSSL or used by the BitCoin reference implementation in its wallet storage format.

ToString ( ) : string
Verify ( byte data, byte signature ) : bool

Verifies the given ASN.1 encoded ECDSA signature against a hash using the public key.

Verify ( byte data, byte signature, byte pub ) : bool

Verifies the given ASN.1 encoded ECDSA signature against a hash using the public key.

비공개 메소드들

메소드 설명
EcKey ( ) : System
ExtractPrivateKeyFromAsn1 ( byte asn1PrivKey ) : BigInteger
PublicKeyFromPrivate ( BigInteger privKey ) : byte[]

Derive the public key by doing a point multiply of G * priv.

메소드 상세

EcKey() 공개 메소드

Creates an ECKey given only the private key. This works because EC public keys are derivable from their private keys by doing a multiply with the generator value.
public EcKey ( BigInteger privKey ) : System
privKey Org.BouncyCastle.Math.BigInteger
리턴 System

FromAsn1() 공개 정적인 메소드

Construct an ECKey from an ASN.1 encoded private key. These are produced by OpenSSL and stored by the BitCoin reference implementation in its wallet.
public static FromAsn1 ( byte asn1PrivKey ) : EcKey
asn1PrivKey byte
리턴 EcKey

GetPrivKeyBytes() 공개 메소드

Returns a 32 byte array containing the private key.
public GetPrivKeyBytes ( ) : byte[]
리턴 byte[]

GetPrivateKeyEncoded() 공개 메소드

Exports the private key in the form used by the Satoshi client "dumpprivkey" and "importprivkey" commands. Use the DumpedPrivateKey.ToString method to get the string.
public GetPrivateKeyEncoded ( NetworkParameters @params ) : DumpedPrivateKey
@params NetworkParameters
리턴 DumpedPrivateKey

Sign() 공개 메소드

Calculates an ECDSA signature in DER format for the given input hash. Note that the input is expected to be 32 bytes long.
public Sign ( byte input ) : byte[]
input byte
리턴 byte[]

ToAddress() 공개 메소드

Returns the address that corresponds to the public part of this ECKey. Note that an address is derived from the RIPEMD-160 hash of the public key and is not the public key itself (which is too large to be convenient).
public ToAddress ( NetworkParameters @params ) : Address
@params NetworkParameters
리턴 Address

ToAsn1() 공개 메소드

Output this ECKey as an ASN.1 encoded private key, as understood by OpenSSL or used by the BitCoin reference implementation in its wallet storage format.
public ToAsn1 ( ) : byte[]
리턴 byte[]

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

Verify() 공개 메소드

Verifies the given ASN.1 encoded ECDSA signature against a hash using the public key.
public Verify ( byte data, byte signature ) : bool
data byte Hash of the data to verify.
signature byte ASN.1 encoded signature.
리턴 bool

Verify() 공개 정적인 메소드

Verifies the given ASN.1 encoded ECDSA signature against a hash using the public key.
public static Verify ( byte data, byte signature, byte pub ) : bool
data byte Hash of the data to verify.
signature byte ASN.1 encoded signature.
pub byte The public key bytes to use.
리턴 bool