MCPcopy Create free account
hub / github.com/C2SP/wycheproof / validatePem

Function validatePem

tools/vectorlint/main.go:137–149  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

135}
136
137func validatePem(value any) error {
138 strVal, ok := value.(string)
139 if !ok {
140 return errors.New("invalid non-string Pem value")
141 }
142
143 _, rest := pem.Decode([]byte(strVal))
144 if len(rest) != 0 {
145 return fmt.Errorf("invalid Pem value: unexpected trailing bytes %x", rest)
146 }
147
148 return nil
149}
150
151// TODO(XXX): standardize on curve name representation, use a schema enum instead of a type.
152var curveNames = map[string]bool{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected