code: func CreateMasterKeyObject(ctx context.Context, password []byte, masterKey *[]byte) (*primitive.MasterKey, error) {
  	m := &primitive.MasterKey{
  		Alg: Triplesec,
  	}
  
  	// We either need to generate a new key, or will use the existing
  	// key during a password change scenario
  	key := make([]byte, masterKeyBytes)
  	if masterKey == nil {
  		// Generate a master key of 256 bytes
  		_, err := rand.Read(key)
  		if err != nil {
  			return nil, err
  		}
  	} else {
  		// Use the provided key
  		key = *masterKey
  	}
  
  	err := ctxutil.ErrIfDone(ctx)
  	if err != nil {
  		return nil, err
  	}
  
  	ts, err := newTriplesec(ctx, password)
  	if err != nil {
  		return nil, err
  	}
  
  	ct, err := ts.Encrypt(key)
  	if err != nil {
  		return nil, err
  	}
  
  	// Encode the master key value to base64url
  	m.Value = base64url.New(ct)
  	return m, nil
  }
docs: // CreateMasterKeyObject generates a 256 byte master key which is then
  // encrypted using TripleSec-v3 using the given password.