Table of Contents

Class StandardDsaEncoding

Namespace
Org.BouncyCastle.Crypto.Signers
Assembly
BouncyCastle.Cryptography.dll
public class StandardDsaEncoding : IDsaEncoding
Inheritance
StandardDsaEncoding
Implements
Inherited Members

Fields

Instance

public static readonly StandardDsaEncoding Instance

Field Value

StandardDsaEncoding

Methods

CheckValue(BigInteger, BigInteger)

protected virtual BigInteger CheckValue(BigInteger n, BigInteger x)

Parameters

n BigInteger
x BigInteger

Returns

BigInteger

Decode(BigInteger, byte[])

Decode the (r, s) pair of a DSA signature.

public virtual BigInteger[] Decode(BigInteger n, byte[] encoding)

Parameters

n BigInteger

The order of the group that r, s belong to.

encoding byte[]

An encoding of the (r, s) pair of a DSA signature.

Returns

BigInteger[]

The (r, s) of a DSA signature, stored in an array of exactly two elements, r followed by s.

DecodeValue(BigInteger, Asn1Sequence, int)

protected virtual BigInteger DecodeValue(BigInteger n, Asn1Sequence s, int pos)

Parameters

n BigInteger
s Asn1Sequence
pos int

Returns

BigInteger

Encode(BigInteger, BigInteger, BigInteger)

Encode the (r, s) pair of a DSA signature.

public virtual byte[] Encode(BigInteger n, BigInteger r, BigInteger s)

Parameters

n BigInteger

The order of the group that r, s belong to.

r BigInteger

The r value of a DSA signature.

s BigInteger

The s value of a DSA signature.

Returns

byte[]

An encoding of the DSA signature given by the provided (r, s) pair.

Encode(BigInteger, BigInteger, BigInteger, Span<byte>)

public virtual int Encode(BigInteger n, BigInteger r, BigInteger s, Span<byte> output)

Parameters

n BigInteger
r BigInteger
s BigInteger
output Span<byte>

Returns

int

EncodeValue(BigInteger, BigInteger)

protected virtual DerInteger EncodeValue(BigInteger n, BigInteger x)

Parameters

n BigInteger
x BigInteger

Returns

DerInteger

GetMaxEncodingSize(BigInteger)

public virtual int GetMaxEncodingSize(BigInteger n)

Parameters

n BigInteger

Returns

int