mirror of
https://github.com/gregtwallace/apc-p15-tool.git
synced 2025-01-22 00:04:09 +00:00
create: set file permissiosns to owner only
This commit is contained in:
parent
da84a7b085
commit
f0253ccaf2
1 changed files with 5 additions and 5 deletions
|
@ -48,13 +48,13 @@ func (app *app) cmdCreate(_ context.Context, args []string) error {
|
|||
}
|
||||
|
||||
// write files
|
||||
err = os.WriteFile(keyCertFileName, apcKeyCertFile, 0777)
|
||||
err = os.WriteFile(keyCertFileName, apcKeyCertFile, 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create: failed to write apc p15 key+cert file (%s)", err)
|
||||
}
|
||||
app.stdLogger.Printf("create: apc p15 key+cert file %s written to disk", keyCertFileName)
|
||||
|
||||
err = os.WriteFile(keyFileName, keyFile, 0777)
|
||||
err = os.WriteFile(keyFileName, keyFile, 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create: failed to write apc p15 key file (%s)", err)
|
||||
}
|
||||
|
@ -64,21 +64,21 @@ func (app *app) cmdCreate(_ context.Context, args []string) error {
|
|||
// easy to do e.g., https://lapo.it/asn1js)
|
||||
if app.config.debugLogging != nil && *app.config.debugLogging {
|
||||
keyCertFileNameDebug := keyCertFileName + ".noheader.b64"
|
||||
err = os.WriteFile(keyCertFileNameDebug, []byte(base64.StdEncoding.EncodeToString(apcKeyCertFile[apcHeaderLen:])), 0777)
|
||||
err = os.WriteFile(keyCertFileNameDebug, []byte(base64.StdEncoding.EncodeToString(apcKeyCertFile[apcHeaderLen:])), 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create: failed to write apc p15 key+cert file (%s)", err)
|
||||
}
|
||||
app.debugLogger.Printf("create: apc p15 key+cert file %s written to disk", keyCertFileNameDebug)
|
||||
|
||||
keyCertFileNameHeaderDebug := keyCertFileName + ".header.b64"
|
||||
err = os.WriteFile(keyCertFileNameHeaderDebug, []byte(base64.StdEncoding.EncodeToString(apcKeyCertFile[apcHeaderLen:])), 0777)
|
||||
err = os.WriteFile(keyCertFileNameHeaderDebug, []byte(base64.StdEncoding.EncodeToString(apcKeyCertFile[apcHeaderLen:])), 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create: failed to write apc p15 key+cert file (%s)", err)
|
||||
}
|
||||
app.debugLogger.Printf("create: apc p15 key+cert file header %s written to disk", keyCertFileNameHeaderDebug)
|
||||
|
||||
keyFileNameDebug := keyFileName + ".b64"
|
||||
err = os.WriteFile(keyFileNameDebug, []byte(base64.StdEncoding.EncodeToString(keyFile)), 0777)
|
||||
err = os.WriteFile(keyFileNameDebug, []byte(base64.StdEncoding.EncodeToString(keyFile)), 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create: failed to write apc p15 key file (%s)", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue