0
0
Fork 0

add documentation to rsa functions

This commit is contained in:
Gibheer 2015-02-19 21:50:07 +01:00
parent 80db488cbd
commit 2fa7332719
1 changed files with 3 additions and 0 deletions

3
rsa.go
View File

@ -56,10 +56,12 @@ func (pr RsaPrivateKey) MarshalPem() (marshalledPemBlock, error) {
return pem.EncodeToMemory(&pem_block), nil
}
// restore a rsa public key
func LoadPublicKeyRsa(raw []byte) (*RsaPublicKey, error) {
return nil, errors.New("not implemented yet!")
}
// marshal a rsa public key into pem format
func (pu *RsaPublicKey) MarshalPem() (marshalledPemBlock, error) {
asn1, err := x509.MarshalPKIXPublicKey(pu.public_key)
if err != nil { return nil, err }
@ -67,6 +69,7 @@ func (pu *RsaPublicKey) MarshalPem() (marshalledPemBlock, error) {
return pem.EncodeToMemory(&pem_block), nil
}
// verify a message with a signature using the public key
func (pu *RsaPublicKey) Verify(message []byte, signature []byte, hash crypto.Hash) (bool, error) {
return false, errors.New("not implemented yet!")
}