aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-07-19 00:39:44 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-07-19 00:39:44 +0200
commit192414f67f722599467ab621c7348e41574fd759 (patch)
treee07ccbac977052dafadb20c42d124243a4481609
parent3a4c53ba05302cdf76bc5620e5d5bc5e654d3e05 (diff)
unexport
-rw-r--r--file/names.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/file/names.go b/file/names.go
index 6bf440b..1ef1246 100644
--- a/file/names.go
+++ b/file/names.go
@@ -11,9 +11,9 @@ import (
var ErrNames = errors.New("please use naming scheme of keyname.pub and keyname.sec")
const (
- PubExt = ".pub"
- EncExt = ".sec"
- SigExt = ".sig"
+ extPub = ".pub"
+ extEnc = ".sec"
+ extSig = ".sig"
verifyWith = "verify with "
)
@@ -26,7 +26,7 @@ func splitNameExt(fname string) (string, string) {
func CheckNames(pubFile, encFile string) error {
pubName, pubExt := splitNameExt(pubFile)
encName, encExt := splitNameExt(encFile)
- if pubExt != PubExt || encExt != EncExt || pubName != encName {
+ if pubExt != extPub || encExt != extEnc || pubName != encName {
return ErrNames
}
return nil
@@ -34,17 +34,17 @@ func CheckNames(pubFile, encFile string) error {
func PubName(encFile string) string {
ext := filepath.Ext(encFile)
- return filepath.Base(encFile[:len(ext)-1] + PubExt)
+ return filepath.Base(encFile[:len(ext)-1] + extPub)
}
func SigName(msgFile string) string {
- return msgFile + SigExt
+ return msgFile + extSig
}
func PubFile(comment string) (string, bool) {
if strings.HasPrefix(comment, verifyWith) {
file := comment[len(verifyWith):]
- if strings.HasSuffix(file, PubExt) {
+ if strings.HasSuffix(file, extPub) {
return FindFile(file), true
}
}