コード例 #1
0
ファイル: store.go プロジェクト: andviro/go-cryptoapi
// findCerts returns slice of *Cert's in store that satisfy findType and findPara
func (s CertStore) findCerts(findType C.DWORD, findPara unsafe.Pointer) []Cert {
	var res []Cert

	for pCert := C.CertFindCertificateInStore(s.hStore, C.MY_ENC_TYPE, 0, findType, findPara, nil); pCert != nil; pCert = C.CertFindCertificateInStore(s.hStore, C.MY_ENC_TYPE, 0, findType, findPara, pCert) {
		pCertDup := C.CertDuplicateCertificateContext(pCert)
		res = append(res, Cert{pCertDup})
	}
	return res
}
コード例 #2
0
ファイル: store.go プロジェクト: andviro/go-cryptoapi
// getCert returns first of Cert's in store that satisfy findType and findPara
func (s CertStore) getCert(findType C.DWORD, findPara unsafe.Pointer) C.PCCERT_CONTEXT {
	return C.CertFindCertificateInStore(s.hStore, C.MY_ENC_TYPE, 0, findType, findPara, nil)
}
コード例 #3
0
ファイル: store.go プロジェクト: Paher/go-cryptoapi
// GetCert returns first of Cert's in store that satisfy findType and findPara
func (s *CertStore) GetCert(findType C.DWORD, findPara unsafe.Pointer) *Cert {
	if pCert := C.CertFindCertificateInStore(s.hStore, C.MY_ENC_TYPE, 0, findType, findPara, nil); pCert != nil {
		return &Cert{pCert}
	}
	return nil
}