Skip to content

Commit

Permalink
优化文档
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Feb 21, 2024
1 parent fde9ff7 commit bc617ae
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/ecdh.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Error()
func main() {
// 可用参数 [P521 | P384 | P256 | X25519]
obj := ecdh.New().
SetCurve("P256").
GenerateKey()
SetCurve("P256").
GenerateKey()

// 私钥密码
// privatekey password
Expand Down
4 changes: 2 additions & 2 deletions docs/ed448.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func main() {
// privatekey password
var psssword string = ""

// ctx 数据
var ctx string = ""
// ctx 数据
var ctx string = ""

obj := ed448.New()

Expand Down
4 changes: 2 additions & 2 deletions docs/eddsa.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func main() {
// privatekey password
var psssword string = ""

// ctx 数据
var ctx string = ""
// ctx 数据
var ctx string = ""

obj := eddsa.New()

Expand Down
12 changes: 6 additions & 6 deletions docs/sm2.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func main() {
// privatekey password
var psssword string = ""

// 设置 UID 值
var uid []byte = []byte("")
// 设置 UID 值
var uid []byte = []byte("")

obj := sm2.New()

Expand All @@ -102,7 +102,7 @@ func main() {
// FromPKCS1PrivateKeyWithPassword([]byte(priKeyPem), psssword).
// FromPKCS8PrivateKey([]byte(priKeyPem)).
// FromPKCS8PrivateKeyWithPassword([]byte(priKeyPem), psssword).
// WithUID(uid).
// WithUID(uid).
Sign().
// SignASN1().
// SignBytes().
Expand All @@ -114,7 +114,7 @@ func main() {
var res bool = obj.
FromBase64String(sigBase64String).
FromPublicKey([]byte(pubKeyPem)).
// WithUID(uid).
// WithUID(uid).
Verify([]byte(data)).
// VerifyASN1([]byte(data)).
// VerifyBytes([]byte(data)).
Expand Down Expand Up @@ -245,7 +245,7 @@ func main() {
sm2Sign := sm2.New().
FromString(sm2data).
FromPrivateKeyBytes(sm2keyBytes).
WithUID([]byte(sm2userid)).
WithUID([]byte(sm2userid)).
SignBytes().
// SignASN1().
ToBase64String()
Expand All @@ -256,7 +256,7 @@ func main() {
FromBase64String(sm2signdata).
FromPrivateKeyBytes(sm2keyBytes).
MakePublicKey().
WithUID([]byte(sm2userid)).
WithUID([]byte(sm2userid)).
VerifyBytes([]byte(sm2data)).
// VerifyASN1([]byte(sm2data)).
ToVerify()
Expand Down

0 comments on commit bc617ae

Please sign in to comment.