Lines Matching defs:String
35 Msg string
38 func (e StructuralError) Error() string { return "asn1: structure error: " + e.Msg }
42 Msg string
45 func (e SyntaxError) Error() string { return "asn1: syntax error: " + e.Msg }
152 // BIT STRING
154 // BitString is the structure to use when you want an ASN.1 BIT STRING type. A
155 // bit string is padded up to the nearest byte in memory and the number of
191 // parseBitString parses an ASN.1 bit string from the given byte slice and returns it.
194 err = SyntaxError{"zero length BIT STRING"}
201 err = SyntaxError{"invalid padding bits in BIT STRING"}
228 func (oi ObjectIdentifier) String() string {
229 var s string
316 s := string(bytes)
345 s := string(bytes)
362 func parsePrintableString(bytes []byte) (ret string, err error) {
369 ret = string(bytes)
386 // always use the correct string type so we permit it.
392 // parseIA5String parses a ASN.1 IA5String (ASCII string) from the given
394 func parseIA5String(bytes []byte) (ret string, err error) {
401 ret = string(bytes)
407 // parseT61String parses a ASN.1 T61String (8-bit clean string) from the given
409 func parseT61String(bytes []byte) (ret string, err error) {
410 return string(bytes), nil
417 func parseUTF8String(bytes []byte) (ret string, err error) {
419 return "", errors.New("asn1: invalid UTF-8 string")
421 return string(bytes), nil
539 // We pretend that various other string types are
541 // parsed into a []string.
713 // Special case for strings: all the ASN.1 string types map to the Go
714 // type string. getUniversalType returns the tag for PrintableString
715 // when it sees a string, so if we see a different string type on the
885 case reflect.String:
886 var v string
900 // such. We give up and pass it as an 8-bit string.
903 err = SyntaxError{fmt.Sprintf("internal error: unknown string type %d", universalTag)}
910 err = StructuralError{"unsupported: " + v.Type().String()}
925 // setDefaultValue is used to install a default value, from a tag string, into
952 // An ASN.1 BIT STRING can be written to a BitString.
954 // An ASN.1 OCTET STRING can be written to a []byte.
963 // An ASN.1 PrintableString or IA5String can be written to a string.
1000 func UnmarshalWithParams(b []byte, val interface{}, params string) (rest []byte, err error) {