|
@@ -6,14 +6,15 @@ package openpgp
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"crypto"
|
|
"crypto"
|
|
|
- "golang.org/x/crypto/openpgp/armor"
|
|
|
|
|
- "golang.org/x/crypto/openpgp/errors"
|
|
|
|
|
- "golang.org/x/crypto/openpgp/packet"
|
|
|
|
|
- "golang.org/x/crypto/openpgp/s2k"
|
|
|
|
|
"hash"
|
|
"hash"
|
|
|
"io"
|
|
"io"
|
|
|
"strconv"
|
|
"strconv"
|
|
|
"time"
|
|
"time"
|
|
|
|
|
+
|
|
|
|
|
+ "golang.org/x/crypto/openpgp/armor"
|
|
|
|
|
+ "golang.org/x/crypto/openpgp/errors"
|
|
|
|
|
+ "golang.org/x/crypto/openpgp/packet"
|
|
|
|
|
+ "golang.org/x/crypto/openpgp/s2k"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// DetachSign signs message with the private key from signer (which must
|
|
// DetachSign signs message with the private key from signer (which must
|
|
@@ -176,6 +177,9 @@ func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHint
|
|
|
return nil, errors.InvalidArgumentError("no valid signing keys")
|
|
return nil, errors.InvalidArgumentError("no valid signing keys")
|
|
|
}
|
|
}
|
|
|
signer = signKey.PrivateKey
|
|
signer = signKey.PrivateKey
|
|
|
|
|
+ if signer == nil {
|
|
|
|
|
+ return nil, errors.InvalidArgumentError("no private key in signing key")
|
|
|
|
|
+ }
|
|
|
if signer.Encrypted {
|
|
if signer.Encrypted {
|
|
|
return nil, errors.InvalidArgumentError("signing key must be decrypted")
|
|
return nil, errors.InvalidArgumentError("signing key must be decrypted")
|
|
|
}
|
|
}
|