fix typo / improve documentatation

This commit is contained in:
William Gotti 2019-05-13 12:33:01 +00:00 committed by Daniel Huigens
parent 701dc26ab5
commit 5cdec38a18
16 changed files with 77 additions and 187 deletions

View file

@ -12,20 +12,17 @@ import (
"io/ioutil"
)
// ArmorKey make bytes input key to armor format
// Use: ios/android only
// ArmorKey makes bytes input key to armor format
func ArmorKey(input []byte) (string, error) {
return ArmorWithType(input, constants.PublicKeyHeader)
}
// ArmorWithTypeBuffered take input from io.Writer and returns io.WriteCloser which can be read for armored code
// Use: go-pm-crypto, keyring.go
// ArmorWithTypeBuffered takes input from io.Writer and returns io.WriteCloser which can be read for armored code
func ArmorWithTypeBuffered(w io.Writer, armorType string) (io.WriteCloser, error) {
return armor.Encode(w, armorType, nil)
}
// ArmorWithType make bytes input to armor format
// Use: go-pm-crypto
// ArmorWithType makes bytes input to armor format
func ArmorWithType(input []byte, armorType string) (string, error) {
var b bytes.Buffer
@ -43,7 +40,6 @@ func ArmorWithType(input []byte, armorType string) (string, error) {
}
// Unarmor an armored key to bytes key
// Use: go-pm-crypto, attachment.go, keyring.go, session.go, message.go
func Unarmor(input string) ([]byte, error) {
b, err := internal.Unarmor(input)
if err != nil {
@ -52,8 +48,7 @@ func Unarmor(input string) ([]byte, error) {
return ioutil.ReadAll(b.Body)
}
//ReadClearSignedMessage read clear message from a clearsign package (package containing cleartext and signature)
// Use: ios/android only
// ReadClearSignedMessage reads clear message from a clearsign package (package containing cleartext and signature)
func ReadClearSignedMessage(signedMessage string) (string, error) {
modulusBlock, rest := clearsign.Decode([]byte(signedMessage))
if len(rest) != 0 {