FreeRDP
asn1.h File Reference
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#include <winpr/stream.h>
This graph shows which files directly or indirectly include this file:

Data Structures

struct  WinPrAsn1Decoder
 
struct  WinPrAsn1_MemoryChunk
 
struct  WinPrAsn1_UTCTIME
 

Macros

#define ER_TAG_MASK   0x1F
 

Typedefs

typedef BYTE WinPrAsn1_tag
 
typedef BYTE WinPrAsn1_tagId
 
typedef BOOL WinPrAsn1_BOOL
 
typedef INT32 WinPrAsn1_INTEGER
 
typedef INT32 WinPrAsn1_ENUMERATED
 
typedef char * WinPrAsn1_STRING
 
typedef char * WinPrAsn1_IA5STRING
 
typedef WinPrAsn1_MemoryChunk WinPrAsn1_OID
 
typedef WinPrAsn1_MemoryChunk WinPrAsn1_OctetString
 

Enumerations

enum  {
  ER_TAG_BOOLEAN = 0x01 , ER_TAG_INTEGER = 0x02 , ER_TAG_BIT_STRING = 0x03 , ER_TAG_OCTET_STRING = 0x04 ,
  ER_TAG_NULL = 0x05 , ER_TAG_OBJECT_IDENTIFIER = 0x06 , ER_TAG_ENUMERATED = 0x0A , ER_TAG_UTF8STRING = 0x0C ,
  ER_TAG_PRINTABLE_STRING = 0x13 , ER_TAG_IA5STRING = 0x16 , ER_TAG_UTCTIME = 0x17 , ER_TAG_GENERAL_STRING = 0x1B ,
  ER_TAG_GENERALIZED_TIME = 0x18 , ER_TAG_APP = 0x60 , ER_TAG_SEQUENCE = 0x30 , ER_TAG_SEQUENCE_OF = 0x30 ,
  ER_TAG_SET = 0x31 , ER_TAG_SET_OF = 0x31 , ER_TAG_CONTEXTUAL = 0xA0
}
 
enum  WinPrAsn1EncodingRule { WINPR_ASN1_BER , WINPR_ASN1_DER }
 rules for encoding More...
 

Functions

WINPR_API void WinPrAsn1FreeOID (WinPrAsn1_OID *poid)
 
WINPR_API void WinPrAsn1FreeOctetString (WinPrAsn1_OctetString *octets)
 
WINPR_API void WinPrAsn1Decoder_Init (WinPrAsn1Decoder *dec, WinPrAsn1EncodingRule encoding, wStream *source)
 
WINPR_API void WinPrAsn1Decoder_InitMem (WinPrAsn1Decoder *dec, WinPrAsn1EncodingRule encoding, const BYTE *source, size_t len)
 
WINPR_API BOOL WinPrAsn1DecPeekTag (WinPrAsn1Decoder *dec, WinPrAsn1_tag *tag)
 
WINPR_API size_t WinPrAsn1DecReadTagAndLen (WinPrAsn1Decoder *dec, WinPrAsn1_tag *tag, size_t *len)
 
WINPR_API size_t WinPrAsn1DecPeekTagAndLen (WinPrAsn1Decoder *dec, WinPrAsn1_tag *tag, size_t *len)
 
WINPR_API size_t WinPrAsn1DecReadTagLenValue (WinPrAsn1Decoder *dec, WinPrAsn1_tag *tag, size_t *len, WinPrAsn1Decoder *value)
 
WINPR_API size_t WinPrAsn1DecReadBoolean (WinPrAsn1Decoder *dec, WinPrAsn1_BOOL *target)
 
WINPR_API size_t WinPrAsn1DecReadInteger (WinPrAsn1Decoder *dec, WinPrAsn1_INTEGER *target)
 
WINPR_API size_t WinPrAsn1DecReadEnumerated (WinPrAsn1Decoder *dec, WinPrAsn1_ENUMERATED *target)
 
WINPR_API size_t WinPrAsn1DecReadOID (WinPrAsn1Decoder *dec, WinPrAsn1_OID *target, BOOL allocate)
 
WINPR_API size_t WinPrAsn1DecReadOctetString (WinPrAsn1Decoder *dec, WinPrAsn1_OctetString *target, BOOL allocate)
 
WINPR_API size_t WinPrAsn1DecReadIA5String (WinPrAsn1Decoder *dec, WinPrAsn1_IA5STRING *target)
 
WINPR_API size_t WinPrAsn1DecReadGeneralString (WinPrAsn1Decoder *dec, WinPrAsn1_STRING *target)
 
WINPR_API size_t WinPrAsn1DecReadUtcTime (WinPrAsn1Decoder *dec, WinPrAsn1_UTCTIME *target)
 
WINPR_API size_t WinPrAsn1DecReadNull (WinPrAsn1Decoder *dec)
 
WINPR_API size_t WinPrAsn1DecReadApp (WinPrAsn1Decoder *dec, WinPrAsn1_tagId *tagId, WinPrAsn1Decoder *setDec)
 
WINPR_API size_t WinPrAsn1DecReadSequence (WinPrAsn1Decoder *dec, WinPrAsn1Decoder *seqDec)
 
WINPR_API size_t WinPrAsn1DecReadSet (WinPrAsn1Decoder *dec, WinPrAsn1Decoder *setDec)
 
WINPR_API size_t WinPrAsn1DecReadContextualTag (WinPrAsn1Decoder *dec, WinPrAsn1_tagId *tagId, WinPrAsn1Decoder *ctxtDec)
 
WINPR_API size_t WinPrAsn1DecPeekContextualTag (WinPrAsn1Decoder *dec, WinPrAsn1_tagId *tagId, WinPrAsn1Decoder *ctxtDec)
 
WINPR_API size_t WinPrAsn1DecReadContextualBool (WinPrAsn1Decoder *dec, WinPrAsn1_tagId tagId, BOOL *error, WinPrAsn1_BOOL *target)
 
WINPR_API size_t WinPrAsn1DecReadContextualInteger (WinPrAsn1Decoder *dec, WinPrAsn1_tagId tagId, BOOL *error, WinPrAsn1_INTEGER *target)
 
WINPR_API size_t WinPrAsn1DecReadContextualOID (WinPrAsn1Decoder *dec, WinPrAsn1_tagId tagId, BOOL *error, WinPrAsn1_OID *target, BOOL allocate)
 
WINPR_API size_t WinPrAsn1DecReadContextualOctetString (WinPrAsn1Decoder *dec, WinPrAsn1_tagId tagId, BOOL *error, WinPrAsn1_OctetString *target, BOOL allocate)
 
WINPR_API size_t WinPrAsn1DecReadContextualSequence (WinPrAsn1Decoder *dec, WinPrAsn1_tagId tagId, BOOL *error, WinPrAsn1Decoder *target)
 
WINPR_API wStream WinPrAsn1DecGetStream (WinPrAsn1Decoder *dec)
 
WINPR_API void WinPrAsn1Encoder_Free (WinPrAsn1Encoder **penc)
 
WINPR_API WinPrAsn1Encoder * WinPrAsn1Encoder_New (WinPrAsn1EncodingRule encoding)
 
WINPR_API void WinPrAsn1Encoder_Reset (WinPrAsn1Encoder *enc)
 
WINPR_API BOOL WinPrAsn1EncAppContainer (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId)
 
WINPR_API BOOL WinPrAsn1EncSeqContainer (WinPrAsn1Encoder *enc)
 
WINPR_API BOOL WinPrAsn1EncContextualSeqContainer (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId)
 
WINPR_API BOOL WinPrAsn1EncSetContainer (WinPrAsn1Encoder *enc)
 
WINPR_API BOOL WinPrAsn1EncContextualSetContainer (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId)
 
WINPR_API BOOL WinPrAsn1EncContextualContainer (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId)
 
WINPR_API BOOL WinPrAsn1EncOctetStringContainer (WinPrAsn1Encoder *enc)
 
WINPR_API BOOL WinPrAsn1EncContextualOctetStringContainer (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId)
 
WINPR_API size_t WinPrAsn1EncEndContainer (WinPrAsn1Encoder *enc)
 
WINPR_API size_t WinPrAsn1EncRawContent (WinPrAsn1Encoder *enc, const WinPrAsn1_MemoryChunk *c)
 
WINPR_API size_t WinPrAsn1EncContextualRawContent (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId, const WinPrAsn1_MemoryChunk *c)
 
WINPR_API size_t WinPrAsn1EncInteger (WinPrAsn1Encoder *enc, WinPrAsn1_INTEGER integer)
 
WINPR_API size_t WinPrAsn1EncContextualInteger (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId, WinPrAsn1_INTEGER integer)
 
WINPR_API size_t WinPrAsn1EncBoolean (WinPrAsn1Encoder *enc, WinPrAsn1_BOOL b)
 
WINPR_API size_t WinPrAsn1EncContextualBoolean (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId, WinPrAsn1_BOOL b)
 
WINPR_API size_t WinPrAsn1EncEnumerated (WinPrAsn1Encoder *enc, WinPrAsn1_ENUMERATED e)
 
WINPR_API size_t WinPrAsn1EncContextualEnumerated (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId, WinPrAsn1_ENUMERATED e)
 
WINPR_API size_t WinPrAsn1EncOID (WinPrAsn1Encoder *enc, const WinPrAsn1_OID *oid)
 
WINPR_API size_t WinPrAsn1EncContextualOID (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId, const WinPrAsn1_OID *oid)
 
WINPR_API size_t WinPrAsn1EncOctetString (WinPrAsn1Encoder *enc, const WinPrAsn1_OctetString *oid)
 
WINPR_API size_t WinPrAsn1EncContextualOctetString (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId, const WinPrAsn1_OctetString *oid)
 
WINPR_API size_t WinPrAsn1EncIA5String (WinPrAsn1Encoder *enc, WinPrAsn1_IA5STRING ia5)
 
WINPR_API size_t WinPrAsn1EncGeneralString (WinPrAsn1Encoder *enc, WinPrAsn1_STRING str)
 
WINPR_API size_t WinPrAsn1EncContextualIA5String (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId, WinPrAsn1_IA5STRING ia5)
 
WINPR_API size_t WinPrAsn1EncUtcTime (WinPrAsn1Encoder *enc, const WinPrAsn1_UTCTIME *utc)
 
WINPR_API size_t WinPrAsn1EncContextualUtcTime (WinPrAsn1Encoder *enc, WinPrAsn1_tagId tagId, const WinPrAsn1_UTCTIME *utc)
 
WINPR_API BOOL WinPrAsn1EncStreamSize (WinPrAsn1Encoder *enc, size_t *s)
 
WINPR_API BOOL WinPrAsn1EncToStream (WinPrAsn1Encoder *enc, wStream *s)
 

Macro Definition Documentation

◆ ER_TAG_MASK

#define ER_TAG_MASK   0x1F

WinPR: Windows Portable Runtime ASN1 encoder / decoder

Copyright 2022 David Fort conta.nosp@m.ct@h.nosp@m.arden.nosp@m.ing-.nosp@m.consu.nosp@m.ltin.nosp@m.g.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Typedef Documentation

◆ WinPrAsn1_BOOL

typedef BOOL WinPrAsn1_BOOL

◆ WinPrAsn1_ENUMERATED

typedef INT32 WinPrAsn1_ENUMERATED

◆ WinPrAsn1_IA5STRING

typedef char* WinPrAsn1_IA5STRING

◆ WinPrAsn1_INTEGER

typedef INT32 WinPrAsn1_INTEGER

◆ WinPrAsn1_OctetString

◆ WinPrAsn1_OID

◆ WinPrAsn1_STRING

typedef char* WinPrAsn1_STRING

◆ WinPrAsn1_tag

◆ WinPrAsn1_tagId

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ER_TAG_BOOLEAN 
ER_TAG_INTEGER 
ER_TAG_BIT_STRING 
ER_TAG_OCTET_STRING 
ER_TAG_NULL 
ER_TAG_OBJECT_IDENTIFIER 
ER_TAG_ENUMERATED 
ER_TAG_UTF8STRING 
ER_TAG_PRINTABLE_STRING 
ER_TAG_IA5STRING 
ER_TAG_UTCTIME 
ER_TAG_GENERAL_STRING 
ER_TAG_GENERALIZED_TIME 
ER_TAG_APP 
ER_TAG_SEQUENCE 
ER_TAG_SEQUENCE_OF 
ER_TAG_SET 
ER_TAG_SET_OF 
ER_TAG_CONTEXTUAL 

◆ WinPrAsn1EncodingRule

rules for encoding

Enumerator
WINPR_ASN1_BER 
WINPR_ASN1_DER 

Function Documentation

◆ WinPrAsn1DecGetStream()

WINPR_API wStream WinPrAsn1DecGetStream ( WinPrAsn1Decoder dec)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1Decoder_Init()

WINPR_API void WinPrAsn1Decoder_Init ( WinPrAsn1Decoder dec,
WinPrAsn1EncodingRule  encoding,
wStream source 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1Decoder_InitMem()

WINPR_API void WinPrAsn1Decoder_InitMem ( WinPrAsn1Decoder dec,
WinPrAsn1EncodingRule  encoding,
const BYTE source,
size_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecPeekContextualTag()

WINPR_API size_t WinPrAsn1DecPeekContextualTag ( WinPrAsn1Decoder dec,
WinPrAsn1_tagId tagId,
WinPrAsn1Decoder ctxtDec 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecPeekTag()

WINPR_API BOOL WinPrAsn1DecPeekTag ( WinPrAsn1Decoder dec,
WinPrAsn1_tag tag 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecPeekTagAndLen()

WINPR_API size_t WinPrAsn1DecPeekTagAndLen ( WinPrAsn1Decoder dec,
WinPrAsn1_tag tag,
size_t *  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadApp()

WINPR_API size_t WinPrAsn1DecReadApp ( WinPrAsn1Decoder dec,
WinPrAsn1_tagId tagId,
WinPrAsn1Decoder setDec 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadBoolean()

WINPR_API size_t WinPrAsn1DecReadBoolean ( WinPrAsn1Decoder dec,
WinPrAsn1_BOOL target 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadContextualBool()

WINPR_API size_t WinPrAsn1DecReadContextualBool ( WinPrAsn1Decoder dec,
WinPrAsn1_tagId  tagId,
BOOL *  error,
WinPrAsn1_BOOL target 
)
Here is the call graph for this function:

◆ WinPrAsn1DecReadContextualInteger()

WINPR_API size_t WinPrAsn1DecReadContextualInteger ( WinPrAsn1Decoder dec,
WinPrAsn1_tagId  tagId,
BOOL *  error,
WinPrAsn1_INTEGER target 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadContextualOctetString()

WINPR_API size_t WinPrAsn1DecReadContextualOctetString ( WinPrAsn1Decoder dec,
WinPrAsn1_tagId  tagId,
BOOL *  error,
WinPrAsn1_OctetString target,
BOOL  allocate 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadContextualOID()

WINPR_API size_t WinPrAsn1DecReadContextualOID ( WinPrAsn1Decoder dec,
WinPrAsn1_tagId  tagId,
BOOL *  error,
WinPrAsn1_OID target,
BOOL  allocate 
)
Here is the call graph for this function:

◆ WinPrAsn1DecReadContextualSequence()

WINPR_API size_t WinPrAsn1DecReadContextualSequence ( WinPrAsn1Decoder dec,
WinPrAsn1_tagId  tagId,
BOOL *  error,
WinPrAsn1Decoder target 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadContextualTag()

WINPR_API size_t WinPrAsn1DecReadContextualTag ( WinPrAsn1Decoder dec,
WinPrAsn1_tagId tagId,
WinPrAsn1Decoder ctxtDec 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadEnumerated()

WINPR_API size_t WinPrAsn1DecReadEnumerated ( WinPrAsn1Decoder dec,
WinPrAsn1_ENUMERATED target 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadGeneralString()

WINPR_API size_t WinPrAsn1DecReadGeneralString ( WinPrAsn1Decoder dec,
WinPrAsn1_STRING target 
)
Here is the call graph for this function:

◆ WinPrAsn1DecReadIA5String()

WINPR_API size_t WinPrAsn1DecReadIA5String ( WinPrAsn1Decoder dec,
WinPrAsn1_IA5STRING target 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadInteger()

WINPR_API size_t WinPrAsn1DecReadInteger ( WinPrAsn1Decoder dec,
WinPrAsn1_INTEGER target 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadNull()

WINPR_API size_t WinPrAsn1DecReadNull ( WinPrAsn1Decoder dec)
Here is the call graph for this function:

◆ WinPrAsn1DecReadOctetString()

WINPR_API size_t WinPrAsn1DecReadOctetString ( WinPrAsn1Decoder dec,
WinPrAsn1_OctetString target,
BOOL  allocate 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadOID()

WINPR_API size_t WinPrAsn1DecReadOID ( WinPrAsn1Decoder dec,
WinPrAsn1_OID target,
BOOL  allocate 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadSequence()

WINPR_API size_t WinPrAsn1DecReadSequence ( WinPrAsn1Decoder dec,
WinPrAsn1Decoder seqDec 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadSet()

WINPR_API size_t WinPrAsn1DecReadSet ( WinPrAsn1Decoder dec,
WinPrAsn1Decoder setDec 
)
Here is the call graph for this function:

◆ WinPrAsn1DecReadTagAndLen()

WINPR_API size_t WinPrAsn1DecReadTagAndLen ( WinPrAsn1Decoder dec,
WinPrAsn1_tag tag,
size_t *  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadTagLenValue()

WINPR_API size_t WinPrAsn1DecReadTagLenValue ( WinPrAsn1Decoder dec,
WinPrAsn1_tag tag,
size_t *  len,
WinPrAsn1Decoder value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1DecReadUtcTime()

WINPR_API size_t WinPrAsn1DecReadUtcTime ( WinPrAsn1Decoder dec,
WinPrAsn1_UTCTIME target 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncAppContainer()

WINPR_API BOOL WinPrAsn1EncAppContainer ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncBoolean()

WINPR_API size_t WinPrAsn1EncBoolean ( WinPrAsn1Encoder *  enc,
WinPrAsn1_BOOL  b 
)
Here is the call graph for this function:

◆ WinPrAsn1EncContextualBoolean()

WINPR_API size_t WinPrAsn1EncContextualBoolean ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId,
WinPrAsn1_BOOL  b 
)
Here is the call graph for this function:

◆ WinPrAsn1EncContextualContainer()

WINPR_API BOOL WinPrAsn1EncContextualContainer ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncContextualEnumerated()

WINPR_API size_t WinPrAsn1EncContextualEnumerated ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId,
WinPrAsn1_ENUMERATED  e 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncContextualIA5String()

WINPR_API size_t WinPrAsn1EncContextualIA5String ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId,
WinPrAsn1_IA5STRING  ia5 
)
Here is the call graph for this function:

◆ WinPrAsn1EncContextualInteger()

WINPR_API size_t WinPrAsn1EncContextualInteger ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId,
WinPrAsn1_INTEGER  integer 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncContextualOctetString()

WINPR_API size_t WinPrAsn1EncContextualOctetString ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId,
const WinPrAsn1_OctetString oid 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncContextualOctetStringContainer()

WINPR_API BOOL WinPrAsn1EncContextualOctetStringContainer ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncContextualOID()

WINPR_API size_t WinPrAsn1EncContextualOID ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId,
const WinPrAsn1_OID oid 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncContextualRawContent()

WINPR_API size_t WinPrAsn1EncContextualRawContent ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId,
const WinPrAsn1_MemoryChunk c 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncContextualSeqContainer()

WINPR_API BOOL WinPrAsn1EncContextualSeqContainer ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncContextualSetContainer()

WINPR_API BOOL WinPrAsn1EncContextualSetContainer ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId 
)
Here is the call graph for this function:

◆ WinPrAsn1EncContextualUtcTime()

WINPR_API size_t WinPrAsn1EncContextualUtcTime ( WinPrAsn1Encoder *  enc,
WinPrAsn1_tagId  tagId,
const WinPrAsn1_UTCTIME utc 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncEndContainer()

WINPR_API size_t WinPrAsn1EncEndContainer ( WinPrAsn1Encoder *  enc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncEnumerated()

WINPR_API size_t WinPrAsn1EncEnumerated ( WinPrAsn1Encoder *  enc,
WinPrAsn1_ENUMERATED  e 
)
Here is the call graph for this function:

◆ WinPrAsn1EncGeneralString()

WINPR_API size_t WinPrAsn1EncGeneralString ( WinPrAsn1Encoder *  enc,
WinPrAsn1_STRING  str 
)
Here is the call graph for this function:

◆ WinPrAsn1EncIA5String()

WINPR_API size_t WinPrAsn1EncIA5String ( WinPrAsn1Encoder *  enc,
WinPrAsn1_IA5STRING  ia5 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncInteger()

WINPR_API size_t WinPrAsn1EncInteger ( WinPrAsn1Encoder *  enc,
WinPrAsn1_INTEGER  integer 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncOctetString()

WINPR_API size_t WinPrAsn1EncOctetString ( WinPrAsn1Encoder *  enc,
const WinPrAsn1_OctetString oid 
)
Here is the call graph for this function:

◆ WinPrAsn1EncOctetStringContainer()

WINPR_API BOOL WinPrAsn1EncOctetStringContainer ( WinPrAsn1Encoder *  enc)
Here is the call graph for this function:

◆ WinPrAsn1Encoder_Free()

WINPR_API void WinPrAsn1Encoder_Free ( WinPrAsn1Encoder **  penc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1Encoder_New()

WINPR_API WinPrAsn1Encoder* WinPrAsn1Encoder_New ( WinPrAsn1EncodingRule  encoding)

The encoder is implemented with the goals to:

  • have an API which is convenient to use (avoid computing inner elements size)
  • hide the BER/DER encoding details
  • avoid multiple copies and memory moves when building the content

To achieve this, the encoder contains a big memory block (encoder->pool), and various chunks (encoder->chunks) pointing to that memory block. The idea is to reserve some space in the pool for the container headers when we start a new container element. For example when a sequence is started we reserve 6 bytes which is the maximum size: byte0 + length. Then fill the content of the sequence in further chunks. When a container is closed, we compute the inner size (by adding the size of inner chunks), we write the headers bytes, and we adjust the chunk size accordingly.

For example to encode: SEQ IASTRING(test1) INTEGER(200)

with this code:

WinPrAsn1EncSeqContainer(enc);
WinPrAsn1EncIA5String(enc, "test1");
WinPrAsn1EncInteger(enc, 200);

Memory pool and chunks would look like:

[ reserved for seq][string|5|"test1"][integer|0x81|200] (6 bytes) |--------------—||-------------------------------—| ^ ^ | | chunk0 chunk1

As we try to compact chunks as much as we can, we managed to encode the ia5string and the integer using the same chunk.

When the sequence is closed with:

WinPrAsn1EncEndContainer(enc);

The final pool and chunks will look like:

XXXXXX[seq headers][string|5|"test1"][integer|0x81|200]

  |-----------||----------------------------------|
  ^            ^
  |            |
chunk0       chunk1

The generated content can be retrieved using:

WinPrAsn1EncToStream(enc, targetStream);

It will sequentially write all the chunks in the given target stream.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1Encoder_Reset()

WINPR_API void WinPrAsn1Encoder_Reset ( WinPrAsn1Encoder *  enc)
Here is the caller graph for this function:

◆ WinPrAsn1EncOID()

WINPR_API size_t WinPrAsn1EncOID ( WinPrAsn1Encoder *  enc,
const WinPrAsn1_OID oid 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncRawContent()

WINPR_API size_t WinPrAsn1EncRawContent ( WinPrAsn1Encoder *  enc,
const WinPrAsn1_MemoryChunk c 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncSeqContainer()

WINPR_API BOOL WinPrAsn1EncSeqContainer ( WinPrAsn1Encoder *  enc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncSetContainer()

WINPR_API BOOL WinPrAsn1EncSetContainer ( WinPrAsn1Encoder *  enc)
Here is the call graph for this function:

◆ WinPrAsn1EncStreamSize()

WINPR_API BOOL WinPrAsn1EncStreamSize ( WinPrAsn1Encoder *  enc,
size_t *  s 
)
Here is the caller graph for this function:

◆ WinPrAsn1EncToStream()

WINPR_API BOOL WinPrAsn1EncToStream ( WinPrAsn1Encoder *  enc,
wStream s 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPrAsn1EncUtcTime()

WINPR_API size_t WinPrAsn1EncUtcTime ( WinPrAsn1Encoder *  enc,
const WinPrAsn1_UTCTIME utc 
)
Here is the call graph for this function:

◆ WinPrAsn1FreeOctetString()

WINPR_API void WinPrAsn1FreeOctetString ( WinPrAsn1_OctetString octets)
Here is the call graph for this function:

◆ WinPrAsn1FreeOID()

WINPR_API void WinPrAsn1FreeOID ( WinPrAsn1_OID poid)
Here is the caller graph for this function: