Pular para o conteúdo principal

Asn1Util

Namespace: Lacuna.Pki.Asn1
Assembly: Lacuna.Pki
Class

public static class Asn1Util

Hierarquia: objectAsn1Util

Métodos

DecodeAs<T>(byte[])

Decodes a byte array to an instance of a ASN1 decorated class

public static T DecodeAs<T>(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]The ASN1 encoded content

Parâmetros de tipo

NomeDescrição
TThe ASN1 attribute decorated class type to instantiate

Retorno

T — An instance of T decoded


DecodeIA5String(byte[])

Decodes an ASN1 IA5String primitive content to string

public static string DecodeIA5String(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

string


DecodeIntegerAsBigInteger(byte[])

Decodes an ASN1 Integer primitive content as BigInteger

public static BigInteger DecodeIntegerAsBigInteger(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

BigInteger


DecodeIntegerAsInt32(byte[])

Decodes an ASN1 Integer primitive content as int

public static int DecodeIntegerAsInt32(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

int


DecodeObjectIdentifier(byte[])

Decodes an ASN1 ObjectIdentifier primitive content to OID string

public static string DecodeObjectIdentifier(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

string


DecodeOctetString(byte[])

Decodes an ASN1 OctetString primitive content to byte array

public static byte[] DecodeOctetString(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

byte[]


DecodePrintableString(byte[])

Decodes an ASN1 PrintableString primitive content to string

public static string DecodePrintableString(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

string


DecodeString(byte[])

Decodes any of ASN1 string primitives content to string

public static string DecodeString(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

string


DecodeUtcTimeAsDateTime(byte[])

Decodes an ASN1 UTCTime primitive content as DateTime

public static DateTime DecodeUtcTimeAsDateTime(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

DateTime


DecodeUtcTimeAsDateTimeOffset(byte[])

Decodes an ASN1 UTCTime primitive content as DateTimeOffset

public static DateTimeOffset DecodeUtcTimeAsDateTimeOffset(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

DateTimeOffset


DecodeUtf8String(byte[])

Decodes an ASN1 UTF8String primitive content to string

public static string DecodeUtf8String(byte[] content)

Parâmetros

NomeTipoDescrição
contentbyte[]

Retorno

string


DerEncode(object)

Encodes an ASN1 attribute decorated class instance to DER

public static byte[] DerEncode(object obj)

Parâmetros

NomeTipoDescrição
objobjectThe instance of a ASN1 class

Retorno

byte[] — The DER encoded content


DerEncodeIA5String(string)

Encodes a string to ASN1 DER IA5String

public static byte[] DerEncodeIA5String(string s)

Parâmetros

NomeTipoDescrição
sstring

Retorno

byte[]


DerEncodeInteger(BigInteger)

Encodes a BigInteger to ASN1 DER Integer

public static byte[] DerEncodeInteger(BigInteger i)

Parâmetros

NomeTipoDescrição
iBigInteger

Retorno

byte[]


DerEncodeInteger(int)

Encodes an int to ASN1 DER Integer

public static byte[] DerEncodeInteger(int i)

Parâmetros

NomeTipoDescrição
iint

Retorno

byte[]


DerEncodeObjectIdentifier(string)

Encodes an OID string to ASN1 DER ObjectIdentifier

public static byte[] DerEncodeObjectIdentifier(string oid)

Parâmetros

NomeTipoDescrição
oidstring

Retorno

byte[]


DerEncodeOctetString(byte[])

Encodes a byte array to ASN1 DER OctetString

public static byte[] DerEncodeOctetString(byte[] octetString)

Parâmetros

NomeTipoDescrição
octetStringbyte[]

Retorno

byte[]


DerEncodePrintableString(string)

Encodes a string to ASN1 DER PrintableString

public static byte[] DerEncodePrintableString(string s)

Parâmetros

NomeTipoDescrição
sstring

Retorno

byte[]


DerEncodeUtcTime(DateTime)

Encodes a DateTime to ASN1 DER UTCTime

public static byte[] DerEncodeUtcTime(DateTime time)

Parâmetros

NomeTipoDescrição
timeDateTime

Retorno

byte[]


DerEncodeUtcTime(DateTimeOffset)

Encodes a DateTimeOffset to ASN1 DER UTCTime

public static byte[] DerEncodeUtcTime(DateTimeOffset time)

Parâmetros

NomeTipoDescrição
timeDateTimeOffset

Retorno

byte[]


DerEncodeUtf8String(string)

Encodes a string to ASN1 DER UTF8String

public static byte[] DerEncodeUtf8String(string s)

Parâmetros

NomeTipoDescrição
sstring

Retorno

byte[]


Membros herdados

ToString(), Equals(object), Equals(object, object), ReferenceEquals(object, object), GetHashCode(), GetType(), MemberwiseClone()