Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Fix typos in comments #15

Merged
merged 1 commit into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions certstore_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (s macStore) Import(data []byte, password string) error {
// Close implements the Store interface.
func (s macStore) Close() {}

// macIdentity implements the Identity iterface.
// macIdentity implements the Identity interface.
type macIdentity struct {
ref C.SecIdentityRef
kref C.SecKeyRef
Expand All @@ -124,7 +124,7 @@ func newMacIdentity(ref C.SecIdentityRef) *macIdentity {
return &macIdentity{ref: ref}
}

// Certificate implements the Identity iterface.
// Certificate implements the Identity interface.
func (i *macIdentity) Certificate() (*x509.Certificate, error) {
certRef, err := i.getCertRef()
if err != nil {
Expand All @@ -141,7 +141,7 @@ func (i *macIdentity) Certificate() (*x509.Certificate, error) {
return i.crt, nil
}

// CertificateChain implements the Identity iterface.
// CertificateChain implements the Identity interface.
func (i *macIdentity) CertificateChain() ([]*x509.Certificate, error) {
if i.chain != nil {
return i.chain, nil
Expand Down Expand Up @@ -190,7 +190,7 @@ func (i *macIdentity) CertificateChain() ([]*x509.Certificate, error) {
return chain, nil
}

// Signer implements the Identity iterface.
// Signer implements the Identity interface.
func (i *macIdentity) Signer() (crypto.Signer, error) {
// pre-load the certificate so Public() is less likely to return nil
// unexpectedly.
Expand All @@ -201,7 +201,7 @@ func (i *macIdentity) Signer() (crypto.Signer, error) {
return i, nil
}

// Delete implements the Identity iterface.
// Delete implements the Identity interface.
func (i *macIdentity) Delete() error {
itemList := []C.SecIdentityRef{i.ref}
itemListPtr := (*unsafe.Pointer)(unsafe.Pointer(&itemList[0]))
Expand All @@ -227,7 +227,7 @@ func (i *macIdentity) Delete() error {
return nil
}

// Close implements the Identity iterface.
// Close implements the Identity interface.
func (i *macIdentity) Close() {
if i.ref != nilSecIdentityRef {
C.CFRelease(C.CFTypeRef(i.ref))
Expand All @@ -245,7 +245,7 @@ func (i *macIdentity) Close() {
}
}

// Public implements the crypto.Signer iterface.
// Public implements the crypto.Signer interface.
func (i *macIdentity) Public() crypto.PublicKey {
cert, err := i.Certificate()
if err != nil {
Expand All @@ -255,7 +255,7 @@ func (i *macIdentity) Public() crypto.PublicKey {
return cert.PublicKey
}

// Sign implements the crypto.Signer iterface.
// Sign implements the crypto.Signer interface.
func (i *macIdentity) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error) {
hash := opts.HashFunc()

Expand Down
12 changes: 6 additions & 6 deletions certstore_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (s *winStore) Close() {
s.store = nil
}

// winIdentity implements the Identity iterface.
// winIdentity implements the Identity interface.
type winIdentity struct {
chain []C.PCCERT_CONTEXT
signer *winPrivateKey
Expand All @@ -220,12 +220,12 @@ func newWinIdentity(chain []C.PCCERT_CONTEXT) *winIdentity {
return &winIdentity{chain: chain}
}

// Certificate implements the Identity iterface.
// Certificate implements the Identity interface.
func (i *winIdentity) Certificate() (*x509.Certificate, error) {
return exportCertCtx(i.chain[0])
}

// CertificateChain implements the Identity iterface.
// CertificateChain implements the Identity interface.
func (i *winIdentity) CertificateChain() ([]*x509.Certificate, error) {
var (
certs = make([]*x509.Certificate, len(i.chain))
Expand Down Expand Up @@ -267,7 +267,7 @@ func (i *winIdentity) getPrivateKey() (*winPrivateKey, error) {
return i.signer, nil
}

// Delete implements the Identity iterface.
// Delete implements the Identity interface.
func (i *winIdentity) Delete() error {
// duplicate cert context, since CertDeleteCertificateFromStore will free it.
deleteCtx := C.CertDuplicateCertificateContext(i.chain[0])
Expand All @@ -290,7 +290,7 @@ func (i *winIdentity) Delete() error {
return nil
}

// Close implements the Identity iterface.
// Close implements the Identity interface.
func (i *winIdentity) Close() {
if i.signer != nil {
i.signer.Close()
Expand Down Expand Up @@ -351,7 +351,7 @@ func newWinPrivateKey(certCtx C.PCCERT_CONTEXT, publicKey crypto.PublicKey) (*wi
}
}

// PublicKey implements the crypto.Signer interface.
// Public implements the crypto.Signer interface.
func (wpk *winPrivateKey) Public() crypto.PublicKey {
return wpk.publicKey
}
Expand Down