Skip to content

Commit

Permalink
remove unused content
Browse files Browse the repository at this point in the history
  • Loading branch information
abericyang@gmail.com committed Jun 13, 2020
1 parent f20365f commit 8724864
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 57 deletions.
55 changes: 0 additions & 55 deletions ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,61 +127,6 @@ func TestCACommon_GenerateRSAPKCS1PrivateKeyFP(t *testing.T) {
}
}

//func TestRootCA(t *testing.T) {
// var (
// priKey *rsa.PrivateKey
// err error
// )
//
// if priKey, err = RSALoadPriFP("./tmp/icbc/icbc.key.pem", pksC1); nil != err {
// t.Fatal(err)
// }
//
// if _, errCA = CAGenerateCertificateSelf(&CertSelf{
// CertificateFilePath: filepath.Join("./tmp/icbc", "icbc.crt"),
// Subject: pkix.Name{
// Country: []string{"CN"},
// Organization: []string{"ICBC"},
// OrganizationalUnit: []string{"ICBC GYKJ"},
// Locality: []string{"Beijing"},
// Province: []string{"Beijing"},
// CommonName: "localhost",
// },
// ParentPrivateKey: priKey,
// PublicKey: priKey.Public(),
// NotAfterDays: time.Now().Add(5000 * 24 * time.Hour),
// NotBeforeDays: time.Now(),
// BasicConstraintsValid: true,
// IsCA: true,
// ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, //证书用途(客户端认证,数据加密)
// KeyUsage: x509.KeyUsageCertSign | x509.KeyUsageCRLSign | x509.KeyUsageDataEncipherment,
// SignatureAlgorithm: x509.SHA256WithRSA,
// }); nil != errCA {
// t.Error(errCA)
// }
//}
//
//func TestChildCA(t *testing.T) {
// if _, errCA = CAGenerateCertificate(&Cert{
// ParentCert: parentCert,
// CertSelf: CertSelf{
// CertificateFilePath: filepath.Join(pathcaeccpemp521, caCertificateFileName),
// Subject: CAMockSubject,
// ParentPrivateKey: priKeyP384,
// PublicKey: priKeyP521.Public(),
// NotAfterDays: time.Now(),
// NotBeforeDays: time.Now().Add(5000 * 24 * time.Hour),
// BasicConstraintsValid: true,
// IsCA: true,
// ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth},
// KeyUsage: x509.KeyUsageCertSign | x509.KeyUsageCRLSign | x509.KeyUsageDataEncipherment,
// SignatureAlgorithm: x509.ECDSAWithSHA384,
// },
// }); nil != errCA {
// t.Error(errCA)
// }
//}

func TestCACommon_GenerateRSAPKCS1PrivateKeyFPFabricCA(t *testing.T) {
if priRSAKey, errCA = RSAGeneratePriKey(2048, pathcarsapksc1fabric2048, caPriKeyFileName, "PRIVATE KEY", RSAPKSC1()); nil != errCA {
t.Error(errCA)
Expand Down
2 changes: 1 addition & 1 deletion example/grope/grope_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func two3(ctx *grope.Context) {
twos := &TestTwo{}
_ = ctx.ReceiveJSON(twos)
log.Info("two", log.Field("two", &twos), log.Field("url", ctx.Request().URL.String()))
log.Info("one1", log.Field("resp", ctx.ResponseFile(http.StatusOK, "tmp/httpFileTest/baas.sql")))
log.Info("one1", log.Field("resp", ctx.ResponseFile(http.StatusOK, "tmp/httpFileTest/1.sql")))
}

func two4(ctx *grope.Context) {
Expand Down
2 changes: 1 addition & 1 deletion example/sql/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func connect() {
dbURL := gnomon.EnvGetD(GDBUrl, "127.0.0.1:3306")
dbUser := gnomon.EnvGetD(GDBUser, "root")
dbPass := gnomon.EnvGetD(GDBPass, "root")
dbName := gnomon.EnvGetD(GDBName, "baas")
dbName := gnomon.EnvGetD(GDBName, "test")
if err := sql.Connect(dbURL, dbUser, dbPass, dbName, false, 5, 20); err != nil {
connect()
}
Expand Down

0 comments on commit 8724864

Please sign in to comment.