const public_key_size_p256
pub const public_key_size_p256 = 65用途
公开常量 `public_key_size_p256`。 值为 `65`
参数
无
API
#crypto/ecdsa标准库包 `#crypto/ecdsa`。
const public_key_size_p256pub const public_key_size_p256 = 65公开常量 `public_key_size_p256`。 值为 `65`
无
const public_key_size_p384pub const public_key_size_p384 = 97公开常量 `public_key_size_p384`。 值为 `97`
无
const public_key_size_p521pub const public_key_size_p521 = 133公开常量 `public_key_size_p521`。 值为 `133`
无
const private_key_size_p256pub const private_key_size_p256 = 32公开常量 `private_key_size_p256`。 值为 `32`
无
const private_key_size_p384pub const private_key_size_p384 = 48公开常量 `private_key_size_p384`。 值为 `48`
无
const private_key_size_p521pub const private_key_size_p521 = 66公开常量 `private_key_size_p521`。 值为 `66`
无
const p256pub const p256 = 256公开常量 `p256`。 值为 `256`
无
const p384pub const p384 = 384公开常量 `p384`。 值为 `384`
无
const p521pub const p521 = 521公开常量 `p521`。 值为 `521`
无
generate_keypub fn generate_key(curve int) string生成键。失败时 throw。
curve intstring — 结果字符串
publicpub fn public(private_key &string) string公钥。失败时 throw。
private_key &stringstring — 结果字符串
ecdhpub fn ecdh(private_key &string, peer_public &string) stringecdh,返回 string。失败时 throw。
private_key &stringpeer_public &stringstring — 结果字符串
sign_asn1pub fn sign_asn1(private_key &string, hash &string) string符号ASN.1。失败时 throw。
private_key &stringhash &stringstring — 结果字符串
verify_asn1pub fn verify_asn1(public_key &string, hash &string, signature &string) bool验签ASN.1。
public_key &stringhash &stringsignature &stringbool — 是否成立
parse_private_keypub fn parse_private_key(der &string) string解析为 private key。失败时 throw。
der &stringstring — 结果字符串
marshal_sec1pub fn marshal_sec1(private_key &string) string编码写出sec1。
private_key &stringstring — 结果字符串
marshal_pkcs8pub fn marshal_pkcs8(private_key &string) string编码写出PKCS#8。失败时 throw。
private_key &stringstring — 结果字符串
parse_private_pempub fn parse_private_pem(text &string) string解析为 private pem。失败时 throw。
text &stringstring — 结果字符串
marshal_pkcs8_pempub fn marshal_pkcs8_pem(private_key &string) string编码写出PKCS#8PEM。失败时 throw。
private_key &stringstring — 结果字符串
marshal_sec1_pempub fn marshal_sec1_pem(private_key &string) string编码写出sec1PEM。失败时 throw。
private_key &stringstring — 结果字符串
parse_public_keypub fn parse_public_key(der &string) string解析为 public key。失败时 throw。
der &stringstring — 结果字符串
marshal_pkixpub fn marshal_pkix(public_key &string) string编码写出pkix。失败时 throw。
public_key &stringstring — 结果字符串
parse_public_pempub fn parse_public_pem(text &string) string解析为 public pem。失败时 throw。
text &stringstring — 结果字符串
marshal_pkix_pempub fn marshal_pkix_pem(public_key &string) string编码写出pkixPEM。失败时 throw。
public_key &stringstring — 结果字符串