Go-加密学 - BEGIN CERTIFICATEBEGIN RSA PRIVATE KEY和BEGIN PRIVATE KEY的区别

Posted xiangjai

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Go-加密学 - BEGIN CERTIFICATEBEGIN RSA PRIVATE KEY和BEGIN PRIVATE KEY的区别相关的知识,希望对你有一定的参考价值。

目录

1.1、-----BEGIN CERTIFICATE-----格式密钥:

1.2、-----BEGIN RSA PRIVATE KEY-----格式:

1.3、-----BEGIN PRIVATE KEY-----格式:


1.1、-----BEGIN CERTIFICATE-----格式密钥:

这种密钥的格式是cer的密钥证书,如下图:

-----BEGIN CERTIFICATE-----
MIIGGzCCBAOgAwIBAgIQT+sj2/VNZXSEit/y4T3LOTANBgkqhkiG9w0BAQsFADCB
gjELMAkGA1UEBhMCQ04xEDAOBgNVBAgTB0JlaWppbmcxEDAOBgNVBAcTB0JlaWpp
bmcxEDAOBgNVBAoTB0tpbmdkb20xCzAJBgNVBAMTAkNOMTAwLgYDVQQFEycxODI0
NDc5MDQ5MjA0ODQ4NTgwODgxOTg2NzI1ODI1MDA2MTQ4MjUwHhcNMjIwNjE1MDcz
NjM5WhcNMzIwNjE1MDczNjM5WjCBgjELMAkGA1UEBhMCQ04xEDAOBgNVBAgTB0Jl
aWppbmcxEDAOBgNVBAcTB0JlaWppbmcxEDAOBgNVBAoTB0tpbmdkb20xCzAJBgNV
BAMTAkNOMTAwLgYDVQQFEycxMDYyMjk5Mjg3Mzk5ODUxNTA2ODcxODc4Mzg0MDE5
Nzg5NDQzMTMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCoJXleGN5g
RnPt1L+3xudG7VVR+dOr3IWmG1BdggEWcmLi6UOU8859gVfeR8yP7xv7eWGFpwOs
aiEEWyjvk07sUTdhtSgZyAzUnaY8bayA3aSZ4pmnz5dgIbpU1pWu8N2EMvXxpL6y
Vixd+TTQADA7nfKlPhUQiKnU+31QWyJKafY+GKR1g7QVoAf5C4aPQWlZcJH+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THSWIgpRj6H4Y
0vavaKZh5arumRISmyjtmAXem2Axcd0ap6sTYFKiQP9wtOKql4YX2qV9Ixj3QZUg
UR+TV3mdIl9YK9aGfbaE59IamCwgQkXIvDLukHEFYuVZoFPW5QY7UfKvYcAsWM2A
XMN0Yzt4YFlny/72D3QncwuS/7BvDuZJgllxZlQPm62InP0DAZpHjGNCJhWlO8DJ
5jvD9wSzXui4Su/Yq1keJSNNwKxxONqx1dzHeNSZzX9MwMgZncuzJ3SqCDI5yUM0
924I1oddBuQrD0mjUAq6xs2p3OKpt0ecnwY68V/IOw==
-----END CERTIFICATE-----

1.2、-----BEGIN RSA PRIVATE KEY-----格式:

这个是RSA直接生成没有进行转换的密钥格式

 

1.3、-----BEGIN PRIVATE KEY-----格式:

这个密钥就是上面的密钥PKCS#8格式化后的密钥格式,java中用的私钥一般就是这种格式,但是公钥就不需要转换

以上是关于Go-加密学 - BEGIN CERTIFICATEBEGIN RSA PRIVATE KEY和BEGIN PRIVATE KEY的区别的主要内容,如果未能解决你的问题,请参考以下文章

Go-加密学 - BEGIN CERTIFICATEBEGIN RSA PRIVATE KEY和BEGIN PRIVATE KEY的区别

Go-加密学 - 证书crtpempfxcerkey 作用及区别

Go-加密学 - 证书crtpempfxcerkey 作用及区别

Go-加密学 - 证书crtpempfxcerkey 作用及区别

Go-加密学 - 对称加密

Go-加密学 - 非对称加密