Comments (4)
func Test_ParseCertificate(t *testing.T) {
cert, err := ParseCertificatePEM([]byte(sm2Certificate))
if err != nil {
t.Fatal(err)
}
_, err = json.Marshal(cert)
if err != nil {
t.Fatal(err)
}
}
func getPublicKey(pemContent []byte) (interface{}, error) {
block, _ := pem.Decode(pemContent)
if block == nil {
return nil, errors.New("Failed to parse PEM block")
}
return ParsePKIXPublicKey(block.Bytes)
}
你可以参考这些测试。x509_test.go
from gmsm.
看来你使用的是https://github.com/tjfoc/gmsm , 不是本项目。
from gmsm.
看来你使用的是https://github.com/tjfoc/gmsm , 不是本项目。
因为https://github.com/tjfoc/gmsm 似乎不支持我需要的能力,因此在尝试找其他解决方案,我先按照您的提供的函数去尝试一下,感谢。
from gmsm.
我先关掉这个issue,如果使用本项目时遇到问题,可以提新issue。
from gmsm.
Related Issues (20)
- sm4: gcm reduce byte shuffling
- When dynamic linking, R15 is clobbered by a global variable access and is used here: 03578 HOT 7
- openssl 1.1.1 生成的pem私钥解析失败,是我方法不对吗? HOT 2
- [SM3] implement amd64 AVX version HOT 2
- [SM9] 大佬,请问SM9中的加解密为啥使用hash,而不是hashmac呀 HOT 1
- [sm3] rewrite arm64 asm with neon intrinsics HOT 1
- sm3: amd64, use ANDNL to merge NOTL & ANDL HOT 1
- sm3: amd64, try LEA to replace ADD HOT 3
- sm3: reduce stack memory usage for avx & neon
- sm3: 使用逻辑运算分配律优化FF2 HOT 3
- sm3: optimize SIMD message schedule HOT 1
- sm3: supports amd64 sse version HOT 1
- sm3: 根据GG2的等价公式优化
- sm3: amd64 AVX版本,遇到不支持指令问题 HOT 7
- sm4: 优化线性变换L
- ZUC on Windows 10 64-bit HOT 4
- when the public and private keys of sm2 are converted into hexadecimal strings, the length is not 64 HOT 4
- sm4: SSE 代码在某些CPU架构下报SIGSEGV HOT 28
- sm2: arm64架构性能问题 HOT 18
- [go1.18] Can't upgrade golang.org/x/sys to 0.14.0 due to lower go version support of 1.16 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmsm.