示例#1
0
// AddCertificate marks the provided Certificate as a trusted certificate in
// the given CertificateStore.
func (s *CertificateStore) AddCertificate(cert *Certificate) error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()
	if int(C.X509_STORE_add_cert(s.store, cert.x)) != 1 {
		return errorFromErrorQueue()
	}
	return nil
}
示例#2
0
文件: x509.go 项目: runcom/gossl
func (self *X509Store) AddCert(cert *Certificate) int {
	return int(C.X509_STORE_add_cert(self.Store, cert.x509))
}