Asn1Util
Namespace: Lacuna.Pki.Asn1
Assembly: Lacuna.Pki
Class
public static class Asn1Util
Hierarquia: object → Asn1Util
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
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] | The ASN1 encoded content |
Parâmetros de tipo
| Nome | Descrição |
|---|---|
T | The 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
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodeIntegerAsBigInteger(byte[])
Decodes an ASN1 Integer primitive content as BigInteger
public static BigInteger DecodeIntegerAsBigInteger(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodeIntegerAsInt32(byte[])
Decodes an ASN1 Integer primitive content as int
public static int DecodeIntegerAsInt32(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodeObjectIdentifier(byte[])
Decodes an ASN1 ObjectIdentifier primitive content to OID string
public static string DecodeObjectIdentifier(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodeOctetString(byte[])
Decodes an ASN1 OctetString primitive content to byte array
public static byte[] DecodeOctetString(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodePrintableString(byte[])
Decodes an ASN1 PrintableString primitive content to string
public static string DecodePrintableString(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodeString(byte[])
Decodes any of ASN1 string primitives content to string
public static string DecodeString(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodeUtcTimeAsDateTime(byte[])
Decodes an ASN1 UTCTime primitive content as DateTime
public static DateTime DecodeUtcTimeAsDateTime(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodeUtcTimeAsDateTimeOffset(byte[])
Decodes an ASN1 UTCTime primitive content as DateTimeOffset
public static DateTimeOffset DecodeUtcTimeAsDateTimeOffset(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DecodeUtf8String(byte[])
Decodes an ASN1 UTF8String primitive content to string
public static string DecodeUtf8String(byte[] content)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
content | byte[] |
Retorno
DerEncode(object)
Encodes an ASN1 attribute decorated class instance to DER
public static byte[] DerEncode(object obj)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
obj | object | The 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
| Nome | Tipo | Descrição |
|---|---|---|
s | string |
Retorno
DerEncodeInteger(BigInteger)
Encodes a BigInteger to ASN1 DER Integer
public static byte[] DerEncodeInteger(BigInteger i)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
i | BigInteger |
Retorno
DerEncodeInteger(int)
Encodes an int to ASN1 DER Integer
public static byte[] DerEncodeInteger(int i)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
i | int |
Retorno
DerEncodeObjectIdentifier(string)
Encodes an OID string to ASN1 DER ObjectIdentifier
public static byte[] DerEncodeObjectIdentifier(string oid)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
oid | string |
Retorno
DerEncodeOctetString(byte[])
Encodes a byte array to ASN1 DER OctetString
public static byte[] DerEncodeOctetString(byte[] octetString)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
octetString | byte[] |
Retorno
DerEncodePrintableString(string)
Encodes a string to ASN1 DER PrintableString
public static byte[] DerEncodePrintableString(string s)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
s | string |
Retorno
DerEncodeUtcTime(DateTime)
Encodes a DateTime to ASN1 DER UTCTime
public static byte[] DerEncodeUtcTime(DateTime time)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
time | DateTime |
Retorno
DerEncodeUtcTime(DateTimeOffset)
Encodes a DateTimeOffset to ASN1 DER UTCTime
public static byte[] DerEncodeUtcTime(DateTimeOffset time)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
time | DateTimeOffset |
Retorno
DerEncodeUtf8String(string)
Encodes a string to ASN1 DER UTF8String
public static byte[] DerEncodeUtf8String(string s)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
s | string |
Retorno
Membros herdados
ToString(), Equals(object), Equals(object, object), ReferenceEquals(object, object), GetHashCode(), GetType(), MemberwiseClone()