extension.go 474 Bytes
Newer Older
Marten Seemann's avatar
Marten Seemann committed
1 2
package libp2ptls

3
var extensionPrefix = []int{1, 3, 6, 1, 4, 1, 53594}
Marten Seemann's avatar
Marten Seemann committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

// getPrefixedExtensionID returns an Object Identifier
// that can be used in x509 Certificates.
func getPrefixedExtensionID(suffix []int) []int {
	return append(extensionPrefix, suffix...)
}

// extensionIDEqual compares two extension IDs.
func extensionIDEqual(a, b []int) bool {
	if len(a) != len(b) {
		return false
	}
	for i := range a {
		if a[i] != b[i] {
			return false
		}
	}
	return true
}