Improve documentation for checking
This commit is contained in:
parent
958f3166e5
commit
3f33c71496
2 changed files with 36 additions and 5 deletions
|
|
@ -271,6 +271,15 @@ func (key *Key) Check() (bool, error) {
|
|||
return false, errors.New("gopenpgp: can check only private key")
|
||||
}
|
||||
|
||||
unlocked, err := key.IsUnlocked()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if !unlocked {
|
||||
return false, errors.New("gopenpgp: key is not unlocked")
|
||||
}
|
||||
|
||||
var signBuf bytes.Buffer
|
||||
|
||||
if err = openpgp.DetachSign(&signBuf, key.entity, testReader, nil); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue