Support SPKI Fingerprint Pinning
Support SPKI Fingerprint Pinning for TLSObject
This commit is contained in:
1 parent
267d93f7bd
commit
03b8c094de
6 files changed
+169
-23
No files matched your search
@@ -2,6 +2,7 @@ package tls
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"crypto/x509"
|
||||
"encoding/base64"
|
||||
"encoding/pem"
|
||||
)
|
||||
@@ -34,3 +35,8 @@ func GenerateCertChainHash(rawCerts [][]byte) []byte {
|
||||
}
|
||||
return hashValue
|
||||
}
|
||||
|
||||
func GenerateCertPublicKeyHash(cert *x509.Certificate) []byte {
|
||||
out := sha256.Sum256(cert.RawSubjectPublicKeyInfo)
|
||||
return out[:]
|
||||
}
|
||||
Reference in new issue
Block a user