Documentation ¶
Index ¶
- func Debug(on ...bool) bool
- func Errorf(frm string, arg ...interface{}) error
- func ExplicitMode()
- func ImplicitMode()
- func NewDataReader(r io.Reader, size int) asnReader
- func NewFieldList(fld map[string]interface{}) (*fieldList, error)
- type AsnAny
- type AsnChoice
- type AsnContext
- type AsnData
- func (th *AsnData) AddAny() (out AsnAny, err error)
- func (th *AsnData) AddBitString(val BitStr) error
- func (th *AsnData) AddBoolean(val bool) error
- func (th *AsnData) AddChoice() (out AsnChoice, err error)
- func (th *AsnData) AddEnumerated(val string) error
- func (th *AsnData) AddGeneralizedTime(val time.Time) error
- func (th *AsnData) AddIA5String(val string) error
- func (th *AsnData) AddInteger(val int) error
- func (th *AsnData) AddNumericString(val string) error
- func (th *AsnData) AddObjectDescriptor(val string) error
- func (th *AsnData) AddObjectIdentifier(val OID) error
- func (th *AsnData) AddOctetString(val []byte) error
- func (th *AsnData) AddPrintableString(val string) error
- func (th *AsnData) AddReal(val float64) error
- func (th *AsnData) AddSequence() (out AsnSeq, err error)
- func (th *AsnData) AddUTCTime(val time.Time) error
- func (th *AsnData) AddUTF8String(val string) error
- func (th *AsnData) Any(name string) (out AsnAny, err error)
- func (th *AsnData) AnyBitString(name string, val BitStr) error
- func (th *AsnData) AnyBoolean(name string, val bool) error
- func (th *AsnData) AnyChoice(name string) (out AsnChoice, err error)
- func (th *AsnData) AnyEnumerated(name string, val string) error
- func (th *AsnData) AnyGeneralizedTime(name string, val time.Time) error
- func (th *AsnData) AnyIA5String(name string, val string) error
- func (th *AsnData) AnyInteger(name string, val int) error
- func (th *AsnData) AnyNull(name string) error
- func (th *AsnData) AnyNumericString(name string, val string) error
- func (th *AsnData) AnyObjectDescriptor(name string, val string) error
- func (th *AsnData) AnyObjectIdentifier(name string, val OID) error
- func (th *AsnData) AnyOctetString(name string, val []byte) error
- func (th *AsnData) AnyPrintableString(name string, val string) error
- func (th *AsnData) AnyReal(name string, val float64) error
- func (th *AsnData) AnySequence(name string) (out AsnSeq, err error)
- func (th *AsnData) AnySet(el AsnElm, err error) error
- func (th *AsnData) AnySetByName(name string, el AsnElm, err error) error
- func (th *AsnData) AnyUTCTime(name string, val time.Time) error
- func (th *AsnData) AnyUTF8String(name string, val string) error
- func (th *AsnData) BitString(name string, val BitStr) (out AsnElm, err error)
- func (th *AsnData) Boolean(name string, val bool) (out AsnElm, err error)
- func (th *AsnData) Choice(name string) (out AsnChoice, err error)
- func (th *AsnData) ChoiceAny(name string) (out AsnAny, err error)
- func (th *AsnData) ChoiceBitString(name string, val BitStr) error
- func (th *AsnData) ChoiceBoolean(name string, val bool) error
- func (th *AsnData) ChoiceChoice(name string) (out AsnChoice, err error)
- func (th *AsnData) ChoiceEnumerated(name string, val string) error
- func (th *AsnData) ChoiceGeneralizedTime(name string, val time.Time) error
- func (th *AsnData) ChoiceIA5String(name string, val string) error
- func (th *AsnData) ChoiceInteger(name string, val int) error
- func (th *AsnData) ChoiceNull(name string) error
- func (th *AsnData) ChoiceNumericString(name string, val string) error
- func (th *AsnData) ChoiceObjectDescriptor(name string, val string) error
- func (th *AsnData) ChoiceObjectIdentifier(name string, val OID) error
- func (th *AsnData) ChoiceOctetString(name string, val []byte) error
- func (th *AsnData) ChoicePrintableString(name string, val string) error
- func (th *AsnData) ChoiceReal(name string, val float64) error
- func (th *AsnData) ChoiceSequence(name string) (out AsnSeq, err error)
- func (th *AsnData) ChoiceSet(el AsnElm, err error) error
- func (th *AsnData) ChoiceSetByName(name string, el AsnElm, err error) error
- func (th *AsnData) ChoiceUTCTime(name string, val time.Time) error
- func (th *AsnData) ChoiceUTF8String(name string, val string) error
- func (th *AsnData) Decode(sheme *Sheme) (*simplejson.Json, error)
- func (th *AsnData) Encode() ([]byte, error)
- func (th *AsnData) Enumerated(name string, val string) (out AsnElm, err error)
- func (th *AsnData) GeneralizedTime(name string, val time.Time) (out AsnElm, err error)
- func (th *AsnData) IA5String(name string, val string) (out AsnElm, err error)
- func (th *AsnData) Integer(name string, val int) (out AsnElm, err error)
- func (th *AsnData) Null(name string) (out AsnElm, err error)
- func (th *AsnData) NumericString(name string, val string) (out AsnElm, err error)
- func (th *AsnData) ObjectDescriptor(name string, val string) (out AsnElm, err error)
- func (th *AsnData) ObjectIdentifier(name string, val OID) (out AsnElm, err error)
- func (th *AsnData) OctetString(name string, val []byte) (out AsnElm, err error)
- func (th *AsnData) Parse(data []byte) ([]byte, bool, error)
- func (th *AsnData) PathAny(path ...string) (out AsnAny, err error)
- func (th *AsnData) PathBitString(val BitStr, path ...string) error
- func (th *AsnData) PathBoolean(val bool, path ...string) error
- func (th *AsnData) PathChoice(path ...string) (out AsnChoice, err error)
- func (th *AsnData) PathEnumerated(val string, path ...string) error
- func (th *AsnData) PathGeneralizedTime(val time.Time, path ...string) error
- func (th *AsnData) PathIA5String(val string, path ...string) error
- func (th *AsnData) PathInteger(val int, path ...string) error
- func (th *AsnData) PathNull(path ...string) error
- func (th *AsnData) PathNumericString(val string, path ...string) error
- func (th *AsnData) PathObjectDescriptor(val string, path ...string) error
- func (th *AsnData) PathObjectIdentifier(val OID, path ...string) error
- func (th *AsnData) PathOctetString(val []byte, path ...string) error
- func (th *AsnData) PathPrintableString(val string, path ...string) error
- func (th *AsnData) PathReal(val float64, path ...string) error
- func (th *AsnData) PathSequence(path ...string) (out AsnSeq, err error)
- func (th *AsnData) PathUTCTime(val time.Time, path ...string) error
- func (th *AsnData) PathUTF8String(val string, path ...string) error
- func (th *AsnData) PrintableString(name string, val string) (out AsnElm, err error)
- func (th *AsnData) RawData() []byte
- func (th *AsnData) Real(name string, val float64) (out AsnElm, err error)
- func (th *AsnData) SeqField(el AsnElm, err error) error
- func (th *AsnData) SeqFieldByName(name string, el AsnElm, err error) error
- func (th *AsnData) SeqItem(el AsnElm, err error) error
- func (th *AsnData) Sequence(name string) (out AsnSeq, err error)
- func (th *AsnData) SetAny(name string) (out AsnAny, err error)
- func (th *AsnData) SetBitString(name string, val BitStr) error
- func (th *AsnData) SetBoolean(name string, val bool) error
- func (th *AsnData) SetChoice(name string) (out AsnChoice, err error)
- func (th *AsnData) SetEnumerated(name string, val string) error
- func (th *AsnData) SetGeneralizedTime(name string, val time.Time) error
- func (th *AsnData) SetIA5String(name string, val string) error
- func (th *AsnData) SetInteger(name string, val int) error
- func (th *AsnData) SetNull(name string) error
- func (th *AsnData) SetNumericString(name string, val string) error
- func (th *AsnData) SetObjectDescriptor(name string, val string) error
- func (th *AsnData) SetObjectIdentifier(name string, val OID) error
- func (th *AsnData) SetOctetString(name string, val []byte) error
- func (th *AsnData) SetPrintableString(name string, val string) error
- func (th *AsnData) SetReal(name string, val float64) error
- func (th *AsnData) SetSequence(name string) (out AsnSeq, err error)
- func (th *AsnData) SetUTCTime(name string, val time.Time) error
- func (th *AsnData) SetUTF8String(name string, val string) error
- func (th *AsnData) UTCTime(name string, val time.Time) (out AsnElm, err error)
- func (th *AsnData) UTF8String(name string, val string) (out AsnElm, err error)
- type AsnElm
- type AsnPath
- type AsnSeq
- type AsnTag
- type BitStr
- type OID
- type Sheme
- func (sheme *Sheme) Any() (AsnAny, error)
- func (sheme *Sheme) BitString(val BitStr) (AsnElm, error)
- func (sheme *Sheme) Boolean(val bool) (AsnElm, error)
- func (sheme *Sheme) Choice() (AsnChoice, error)
- func (s *Sheme) Class(class string) *Sheme
- func (s *Sheme) DefAttr() interface{}
- func (s *Sheme) EnumItems() map[int]string
- func (sheme *Sheme) Enumerated(val string) (AsnElm, error)
- func (s *Sheme) Explicit() bool
- func (s *Sheme) Field(name string) *Sheme
- func (s *Sheme) FieldAttr() map[string]interface{}
- func (s *Sheme) FieldKeys() []string
- func (s *Sheme) FieldList() *fieldList
- func (s *Sheme) FormatAttr() string
- func (sheme *Sheme) GeneralizedTime(val time.Time) (AsnElm, error)
- func (sheme *Sheme) IA5String(val string) (AsnElm, error)
- func (s *Sheme) ID() int
- func (s *Sheme) Implicit() bool
- func (s *Sheme) Index() int
- func (sheme *Sheme) Integer(val int) (AsnElm, error)
- func (s *Sheme) MaxAttr() int
- func (s *Sheme) MinAttr() int
- func (s *Sheme) Name() string
- func (sheme *Sheme) Null() (AsnElm, error)
- func (sheme *Sheme) NumericString(val string) (AsnElm, error)
- func (sheme *Sheme) ObjectDescriptor(val string) (AsnElm, error)
- func (sheme *Sheme) ObjectIdentifier(val OID) (AsnElm, error)
- func (sheme *Sheme) OctetString(val []byte) (AsnElm, error)
- func (s *Sheme) Of() *Sheme
- func (s *Sheme) OfAttr() map[string]interface{}
- func (s *Sheme) Optional() bool
- func (sheme *Sheme) PrintableString(val string) (AsnElm, error)
- func (sheme *Sheme) Real(val float64) (AsnElm, error)
- func (sheme *Sheme) Sequence() (AsnSeq, error)
- func (s *Sheme) String() string
- func (s *Sheme) Tagged() bool
- func (s *Sheme) Type() string
- func (s *Sheme) TypeEn() int
- func (sheme *Sheme) UTCTime(val time.Time) (AsnElm, error)
- func (sheme *Sheme) UTF8String(val string) (AsnElm, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExplicitMode ¶
func ExplicitMode()
func ImplicitMode ¶
func ImplicitMode()
func NewDataReader ¶
func NewFieldList ¶
Types ¶
type AsnAny ¶
type AsnAny interface { AsnElm AsnPath AnySetByName(name string, el AsnElm, err error) error AnySet(el AsnElm, err error) error AnyNull(name string) error AnyBoolean(name string, val bool) error AnyInteger(name string, val int) error AnyReal(name string, val float64) error AnyEnumerated(name string, val string) error AnyBitString(name string, val BitStr) error AnyUTCTime(name string, val time.Time) error AnyGeneralizedTime(name string, val time.Time) error AnyObjectIdentifier(name string, val OID) error AnyObjectDescriptor(name string, val string) error AnyNumericString(name string, val string) error AnyPrintableString(name string, val string) error AnyIA5String(name string, val string) error AnyUTF8String(name string, val string) error AnyOctetString(name string, val []byte) error AnySequence(name string) (out AsnSeq, err error) AnyChoice(name string) (out AsnChoice, err error) }
type AsnChoice ¶
type AsnChoice interface { AsnElm AsnPath ChoiceSetByName(name string, el AsnElm, err error) error ChoiceSet(el AsnElm, err error) error ChoiceNull(name string) error ChoiceBoolean(name string, val bool) error ChoiceInteger(name string, val int) error ChoiceReal(name string, val float64) error ChoiceEnumerated(name string, val string) error ChoiceBitString(name string, val BitStr) error ChoiceUTCTime(name string, val time.Time) error ChoiceGeneralizedTime(name string, val time.Time) error ChoiceObjectIdentifier(name string, val OID) error ChoiceObjectDescriptor(name string, val string) error ChoiceNumericString(name string, val string) error ChoicePrintableString(name string, val string) error ChoiceIA5String(name string, val string) error ChoiceUTF8String(name string, val string) error ChoiceOctetString(name string, val []byte) error ChoiceSequence(name string) (out AsnSeq, err error) ChoiceChoice(name string) (out AsnChoice, err error) ChoiceAny(name string) (out AsnAny, err error) }
type AsnContext ¶
type AsnContext struct {
// contains filtered or unexported fields
}
type AsnData ¶
type AsnData struct {
// contains filtered or unexported fields
}
func AsnElm2AsnData ¶
func AsnElm2AsnDataSub ¶
func (*AsnData) AddBitString ¶
func (*AsnData) AddBoolean ¶
func (*AsnData) AddEnumerated ¶
func (*AsnData) AddIA5String ¶
func (*AsnData) AddInteger ¶
func (*AsnData) AddNumericString ¶
func (*AsnData) AddObjectDescriptor ¶
func (*AsnData) AddObjectIdentifier ¶
func (*AsnData) AddOctetString ¶
func (*AsnData) AddPrintableString ¶
func (*AsnData) AddSequence ¶
func (*AsnData) AddUTF8String ¶
func (*AsnData) AnyGeneralizedTime ¶
func (*AsnData) AnyNumericString ¶
func (*AsnData) AnyObjectDescriptor ¶
func (*AsnData) AnyObjectIdentifier ¶
func (*AsnData) AnyPrintableString ¶
func (*AsnData) AnySetByName ¶
func (*AsnData) ChoiceChoice ¶
func (*AsnData) ChoiceEnumerated ¶
func (*AsnData) ChoiceGeneralizedTime ¶
func (*AsnData) ChoiceNull ¶
func (*AsnData) ChoiceNumericString ¶
func (*AsnData) ChoiceObjectDescriptor ¶
func (*AsnData) ChoiceObjectIdentifier ¶
func (*AsnData) ChoiceOctetString ¶
func (*AsnData) ChoicePrintableString ¶
func (*AsnData) ChoiceSequence ¶
func (*AsnData) ChoiceSetByName ¶
func (*AsnData) ChoiceUTF8String ¶
func (*AsnData) Enumerated ¶
func (*AsnData) GeneralizedTime ¶
func (*AsnData) NumericString ¶
func (*AsnData) ObjectDescriptor ¶
func (*AsnData) ObjectIdentifier ¶
func (*AsnData) OctetString ¶
func (*AsnData) PathChoice ¶
func (*AsnData) PathEnumerated ¶
func (*AsnData) PathGeneralizedTime ¶
func (*AsnData) PathNumericString ¶
func (*AsnData) PathObjectDescriptor ¶
func (*AsnData) PathObjectIdentifier ¶
func (*AsnData) PathOctetString ¶
func (*AsnData) PathPrintableString ¶
func (*AsnData) PathSequence ¶
func (*AsnData) PathUTF8String ¶
func (*AsnData) PrintableString ¶
func (*AsnData) SeqFieldByName ¶
func (*AsnData) SetGeneralizedTime ¶
func (*AsnData) SetNumericString ¶
func (*AsnData) SetObjectDescriptor ¶
func (*AsnData) SetObjectIdentifier ¶
func (*AsnData) SetPrintableString ¶
type AsnElm ¶
type AsnElm interface { Encode() ([]byte, error) RawData() []byte Decode(sheme *Sheme) (*simplejson.Json, error) Parse(data []byte) ([]byte, bool, error) }
func NewDecoder ¶
func NewDecoder() AsnElm
type AsnPath ¶
type AsnPath interface { PathNull(path ...string) error PathBoolean(val bool, path ...string) error PathInteger(val int, path ...string) error PathReal(val float64, path ...string) error PathEnumerated(val string, path ...string) error PathBitString(val BitStr, path ...string) error PathUTCTime(val time.Time, path ...string) error PathGeneralizedTime(val time.Time, path ...string) error PathObjectIdentifier(val OID, path ...string) error PathObjectDescriptor(val string, path ...string) error PathNumericString(val string, path ...string) error PathPrintableString(val string, path ...string) error PathIA5String(val string, path ...string) error PathUTF8String(val string, path ...string) error PathOctetString(val []byte, path ...string) error PathSequence(path ...string) (out AsnSeq, err error) PathChoice(path ...string) (out AsnChoice, err error) PathAny(path ...string) (out AsnAny, err error) }
type AsnSeq ¶
type AsnSeq interface { AsnElm AsnPath SeqFieldByName(name string, el AsnElm, err error) error SeqField(el AsnElm, err error) error SeqItem(el AsnElm, err error) error SetNull(name string) error SetBoolean(name string, val bool) error SetInteger(name string, val int) error SetReal(name string, val float64) error SetEnumerated(name string, val string) error SetBitString(name string, val BitStr) error SetUTCTime(name string, val time.Time) error SetGeneralizedTime(name string, val time.Time) error SetObjectIdentifier(name string, val OID) error SetObjectDescriptor(name string, val string) error SetNumericString(name string, val string) error SetPrintableString(name string, val string) error SetIA5String(name string, val string) error SetUTF8String(name string, val string) error SetOctetString(name string, val []byte) error SetSequence(name string) (out AsnSeq, err error) SetChoice(name string) (out AsnChoice, err error) SetAny(name string) (out AsnAny, err error) AddBoolean(val bool) error AddInteger(val int) error AddReal(val float64) error AddEnumerated(val string) error AddBitString(val BitStr) error AddUTCTime(val time.Time) error AddGeneralizedTime(val time.Time) error AddObjectIdentifier(val OID) error AddObjectDescriptor(val string) error AddNumericString(val string) error AddPrintableString(val string) error AddIA5String(val string) error AddUTF8String(val string) error AddOctetString(val []byte) error AddSequence() (out AsnSeq, err error) AddChoice() (out AsnChoice, err error) AddAny() (out AsnAny, err error) }
type BitStr ¶
BitString is the structure to use when you want an ASN.1 BIT STRING type. A bit string is padded up to the nearest byte in memory and the number of valid bits is recorded. Padding bits will be zero.
func (BitStr) At ¶
At returns the bit at the given index. If the index is out of range it returns false.
func (BitStr) RightAlign ¶
RightAlign returns a slice where the padding bits are at the beginning. The slice may share memory with the BitString.
type Sheme ¶
type Sheme struct {
// contains filtered or unexported fields
}
func (*Sheme) FormatAttr ¶
Click to show internal directories.
Click to hide internal directories.