mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-22 10:16:18 +08:00
fix test case
This commit is contained in:
parent
a3161b7581
commit
1d894ef955
@ -37,23 +37,23 @@ func TestCreateCertificateRequest(t *testing.T) {
|
||||
Country: []string{"CN"},
|
||||
},
|
||||
}
|
||||
_, err = smx509.CreateCFCACertificateRequest(random, template, "", "", "")
|
||||
_, err = CreateCertificateRequest(random, template, "", "", "")
|
||||
if err == nil || err.Error() != "x509: certificate private key does not implement crypto.Signer" {
|
||||
t.Fatal("certificate private key does not implement crypto.Signer")
|
||||
}
|
||||
_, err = smx509.CreateCFCACertificateRequest(random, template, certKey, "", "")
|
||||
_, err = CreateCertificateRequest(random, template, certKey, "", "")
|
||||
if err == nil || err.Error() != "x509: tmp private key does not implement crypto.Signer" {
|
||||
t.Fatal("tmp private key does not implement crypto.Signer")
|
||||
}
|
||||
_, err = smx509.CreateCFCACertificateRequest(random, template, certKey, invalidTmpKey, "")
|
||||
_, err = CreateCertificateRequest(random, template, certKey, invalidTmpKey, "")
|
||||
if err == nil || err.Error() != "x509: only SM2 public key is supported" {
|
||||
t.Fatal("only SM2 public key is supported")
|
||||
}
|
||||
_, err = smx509.CreateCFCACertificateRequest(random, template, certKey, tmpKey, "")
|
||||
_, err = CreateCertificateRequest(random, template, certKey, tmpKey, "")
|
||||
if err == nil || err.Error() != "x509: challenge password is required" {
|
||||
t.Fatal("challenge password is required")
|
||||
}
|
||||
csrDer, err := smx509.CreateCFCACertificateRequest(random, template, certKey, tmpKey, "111111")
|
||||
csrDer, err := CreateCertificateRequest(random, template, certKey, tmpKey, "111111")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user