func (s CertStore) Certs() (res []Cert) { for pCert := C.CertEnumCertificatesInStore(s.hStore, nil); pCert != nil; pCert = C.CertEnumCertificatesInStore(s.hStore, pCert) { pCertDup := C.CertDuplicateCertificateContext(pCert) res = append(res, Cert{pCertDup}) } return }
// 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 }
func (s *CertStore) Certs() []*Cert { var res []*Cert for pCert := C.CertEnumCertificatesInStore(s.hStore, nil); pCert != nil; pCert = C.CertEnumCertificatesInStore(s.hStore, pCert) { pCertDup := C.CertDuplicateCertificateContext(pCert) res = append(res, &Cert{pCertDup}) } return res }