File: TypedData.go

package info (click to toggle)
golang-gopkg-jcmturner-gokrb5.v5 5.3.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, bullseye-backports, sid
  • size: 1,168 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package types

import "github.com/jcmturner/gofork/encoding/asn1"

// TypedData implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.9.1
type TypedData struct {
	DataType  int32  `asn1:"explicit,tag:0"`
	DataValue []byte `asn1:"optional,explicit,tag:1"`
}

// TypedDataSequence implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.9.1
type TypedDataSequence []TypedData

// Unmarshal bytes into the TypedDataSequence.
func (a *TypedDataSequence) Unmarshal(b []byte) error {
	_, err := asn1.Unmarshal(b, a)
	return err
}