mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-09-24 14:23:47 +08:00
Update Go API to version 1.2
Add Certificate Object, support parse, check and access (very limited) attributes of an X.509 certificate in PEM format.
This commit is contained in:
@@ -7,7 +7,6 @@ package gmssl
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@@ -19,7 +18,7 @@ func SeedRandom(seed []byte) error {
|
||||
func GenerateRandom(length int) ([]byte, error) {
|
||||
outbuf := make([]byte, length)
|
||||
if C.RAND_bytes((*C.uchar)(&outbuf[0]), C.int(length)) <= 0 {
|
||||
return nil, errors.New("GmSSL Failure")
|
||||
return nil, GetErrors()
|
||||
}
|
||||
|
||||
return outbuf[:length], nil
|
||||
|
||||
Reference in New Issue
Block a user