mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Support SPKI Fingerprint Pinning
Support SPKI Fingerprint Pinning for TLSObject
This commit is contained in:
parent
267d93f7bd
commit
03b8c094de
6 changed files with 169 additions and 23 deletions
|
@ -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[:]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue