コード例 #1
0
ファイル: ctx.go プロジェクト: devsaurin/mongo-tools
// CheckPrivateKey verifies that the private key agrees with the corresponding
// public key in the certificate
func (c *Ctx) CheckPrivateKey() error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()
	if int(C.SSL_CTX_check_private_key(c.ctx)) != 1 {
		return errorFromErrorQueue()
	}
	return nil
}
コード例 #2
0
ファイル: context.go プロジェクト: postfix/go-ssl
func (self *Context) CheckPrivateKey() error {
	if int(C.SSL_CTX_check_private_key(self.Ctx)) != 1 {
		return errors.New(sslerr.SSLErrorMessage())
	}
	return nil
}