Skip to content

Commit

Permalink
tidy code
Browse files Browse the repository at this point in the history
  • Loading branch information
wangtiga committed Nov 11, 2023
1 parent 03597fd commit 37b5977
Show file tree
Hide file tree
Showing 22 changed files with 211 additions and 377 deletions.
24 changes: 12 additions & 12 deletions internal/certigo/lib/certs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ func TestClientTLSConfig(t *testing.T) {
derfmt := CertKeyFormatDER
pemfmt := CertKeyFormatPEM
pfxfmt := CertKeyFormatPKCS12
testTLSConfig(t, false, "tls/ca.crt", pemfmt, "tls/client.crt", pemfmt, "tls/client.key", pemfmt, "")
testTLSConfig(t, false, "tls/ca.crt", pemfmt, "tls/client.der", derfmt, "tls/client.key", pemfmt, "")
testTLSConfig(t, false, "tls/ca.crt", pemfmt, "tls/client.pfx", pfxfmt, "tls/client.key", pemfmt, "")
testTLSConfig(t, false, "tls/ca.crt", pemfmt, "tls/client_pass.pfx", pfxfmt, "", pemfmt, "pfxpassword")
testTLSConfig(t, false, "tls/ca.der", derfmt, "tls/client.pfx", pfxfmt, "", pemfmt, "")
testTLSConfig(t, false, "tls/ca.crt", pemfmt, "tls/testcert.pem", pemfmt, "tls/testkey.pem", pemfmt, "")
testTLSConfig(t, false, "internal/testing/tls/ca.crt", pemfmt, "internal/testing/tls/client.crt", pemfmt, "internal/testing/tls/client.key", pemfmt, "")
testTLSConfig(t, false, "internal/testing/tls/ca.crt", pemfmt, "internal/testing/tls/client.der", derfmt, "internal/testing/tls/client.key", pemfmt, "")
testTLSConfig(t, false, "internal/testing/tls/ca.crt", pemfmt, "internal/testing/tls/client.pfx", pfxfmt, "internal/testing/tls/client.key", pemfmt, "")
testTLSConfig(t, false, "internal/testing/tls/ca.crt", pemfmt, "internal/testing/tls/client_pass.pfx", pfxfmt, "", pemfmt, "pfxpassword")
testTLSConfig(t, false, "internal/testing/tls/ca.der", derfmt, "internal/testing/tls/client.pfx", pfxfmt, "", pemfmt, "")
testTLSConfig(t, false, "internal/testing/tls/ca.crt", pemfmt, "internal/testing/tls/testcert.pem", pemfmt, "internal/testing/tls/testkey.pem", pemfmt, "")
}

func testTLSConfig(
Expand All @@ -38,12 +38,12 @@ func testTLSConfig(
}

func TestGuessFormat(t *testing.T) {
guessFormat(t, "tls/client.crt", CertKeyFormatPEM)
guessFormat(t, "tls/client.cer", CertKeyFormatPEM)
guessFormat(t, "tls/client.key", CertKeyFormatPEM)
guessFormat(t, "tls/client.pfx", CertKeyFormatPKCS12)
guessFormat(t, "tls/client.der", CertKeyFormatDER)
forceFormat(t, "tls/client.guess", CertKeyFormatPEM, CertKeyFormatPEM)
guessFormat(t, "internal/testing/tls/client.crt", CertKeyFormatPEM)
guessFormat(t, "internal/testing/tls/client.cer", CertKeyFormatPEM)
guessFormat(t, "internal/testing/tls/client.key", CertKeyFormatPEM)
guessFormat(t, "internal/testing/tls/client.pfx", CertKeyFormatPKCS12)
guessFormat(t, "internal/testing/tls/client.der", CertKeyFormatDER)
forceFormat(t, "internal/testing/tls/client.guess", CertKeyFormatPEM, CertKeyFormatPEM)
}

func guessFormat(t *testing.T, filename string, formatExpected CertificateKeyFormat) {
Expand Down
16 changes: 0 additions & 16 deletions internal/certigo/lib/tls/ca.crl

This file was deleted.

28 changes: 0 additions & 28 deletions internal/certigo/lib/tls/ca.crt

This file was deleted.

Binary file removed internal/certigo/lib/tls/ca.der
Binary file not shown.
51 changes: 0 additions & 51 deletions internal/certigo/lib/tls/ca.key

This file was deleted.

101 changes: 0 additions & 101 deletions internal/certigo/lib/tls/client.cer

This file was deleted.

25 changes: 0 additions & 25 deletions internal/certigo/lib/tls/client.crt

This file was deleted.

16 changes: 0 additions & 16 deletions internal/certigo/lib/tls/client.csr

This file was deleted.

Binary file removed internal/certigo/lib/tls/client.der
Binary file not shown.
Loading

0 comments on commit 37b5977

Please sign in to comment.