more cleanup, fixes

This commit is contained in:
Sanjana Rajan 2018-06-04 17:50:26 -07:00
parent c254bd5d44
commit 04ebe6d459
9 changed files with 33 additions and 53 deletions

6
key.go
View file

@ -190,7 +190,7 @@ func (o *OpenPGP) GenerateKey(userName string, domain string, passphrase string,
return "", err
}
serialized := w.Bytes()
return ArmorWithType(serialized, pgpPrivateBlockType.string())
return ArmorWithType(serialized, pgpPrivateBlockType)
}
// UpdatePrivateKeyPassphrase ...
@ -235,7 +235,7 @@ func (o *OpenPGP) UpdatePrivateKeyPassphrase(privateKey string, oldPassphrase st
}
serialized := w.Bytes()
return ArmorWithType(serialized, pgpPrivateBlockType.string())
return ArmorWithType(serialized, pgpPrivateBlockType)
}
// PublicKey get a public key from a private key
@ -251,7 +251,7 @@ func PublicKey(privateKey string) (string, error) {
e.Serialize(&outBuf)
}
outString, err := ArmorKey(outBuf.Bytes())
outString, err := ArmorWithType(outBuf.Bytes(), pgpPublicBlockType)
if err != nil {
return "", nil
}