func (c *context) apply(opts []Options) error {
	for _, fn := range opts {
		if err := fn(c); err != nil {
			return err
		}
	}
	return nil
}
apply the context options and return the first error if exists.
package pemutil
import (
	"bytes"
	"crypto"
	"crypto/ecdsa"
	"crypto/ed25519"
	"crypto/elliptic"
	"crypto/rand"
	"crypto/rsa"
	"crypto/x509"
	"encoding/pem"
	"fmt"
	"io/ioutil"
	"math/big"
	"os"
	"github.com/pkg/errors"
	"github.com/smallstep/cli/crypto/keys"
	"github.com/smallstep/cli/errs"
	"github.com/smallstep/cli/ui"
	"github.com/smallstep/cli/utils"
	"golang.org/x/crypto/ssh"
)
var DefaultEncCipher = x509.PEMCipherAES256
type context struct {
	filename   string
	perm       os.FileMode
	password   []byte
	pkcs8      bool
	openSSH    bool
	comment    string
	firstBlock bool
}
func newContext(name string) *context {
	return &context{
		filename: name,
		perm:     0600,
	}
}