github.com/kubernetes-incubator/kube-aws@v0.16.4/credential/encrypted_file.go (about) 1 package credential 2 3 import "io/ioutil" 4 5 func (c *EncryptedFile) Fingerprint() string { 6 return c.fingerprint 7 } 8 9 func (c *EncryptedFile) Persist() error { 10 if err := ioutil.WriteFile(c.filePath, c.content, 0600); err != nil { 11 return err 12 } 13 if c.fingerprint != "" { 14 return ioutil.WriteFile(c.fingerprintFilePath, []byte(c.fingerprint), 0600) 15 } 16 return nil 17 } 18 19 func (c *EncryptedFile) String() string { 20 return string(c.content) 21 } 22 23 func (c *EncryptedFile) Bytes() []byte { 24 return c.content 25 } 26 27 func (c *EncryptedFile) SetBytes(bytes []byte) { 28 c.content = bytes 29 }