API
#crypto/rsa/oaep
Xu 0.8.8 API
import: #crypto/rsa/oaep
counts: 4 函数, 0 方法, 0 类型, 0 常量, 0 方法集
标准库包 `#crypto/rsa/oaep`。
encrypt_oaep
pub fn encrypt_oaep(pk &rsa.PublicKey, hash int, msg &string, label &string) string
用途
加密oaep。失败时 throw。
参数
pk &rsa.PublicKey- pk(借用,调用方仍持有;类型 &rsa.PublicKey)
hash int- hash(int)
msg &string- 消息(借用,调用方仍持有;类型 &string)
label &string- label(借用,调用方仍持有;类型 &string)
返回
string — 结果字符串
decrypt_oaep
pub fn decrypt_oaep(priv &rsa.PrivateKey, hash int, ciphertext &string, label &string) string
用途
解密oaep。失败时 throw。
参数
priv &rsa.PrivateKey- priv(借用,调用方仍持有;类型 &rsa.PrivateKey)
hash int- hash(int)
ciphertext &string- ciphertext(借用,调用方仍持有;类型 &string)
label &string- label(借用,调用方仍持有;类型 &string)
返回
string — 结果字符串
sign_pss
pub fn sign_pss(priv &rsa.PrivateKey, hash int, hashed &string) string
用途
符号pss。失败时 throw。
参数
priv &rsa.PrivateKey- priv(借用,调用方仍持有;类型 &rsa.PrivateKey)
hash int- hash(int)
hashed &string- hashed(借用,调用方仍持有;类型 &string)
返回
string — 结果字符串
verify_pss
pub fn verify_pss(pk &rsa.PublicKey, hash int, hashed &string, sig &string) int
用途
验签pss。失败时 throw。
参数
pk &rsa.PublicKey- pk(借用,调用方仍持有;类型 &rsa.PublicKey)
hash int- hash(int)
hashed &string- hashed(借用,调用方仍持有;类型 &string)
sig &string- sig(借用,调用方仍持有;类型 &string)
返回
int — 该类型的值