Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for generateKeys (0.1 sec)

  1. docs/debugging/inspect/main.go

    		}
    		fatalErr(err)
    	}
    
    	// Export xl.meta to stdout
    	if *export {
    		fatalErr(inspectToExportType(outputFileName, *djson))
    		os.Remove(outputFileName)
    	}
    }
    
    func generateKeys() {
    	privatekey, err := rsa.GenerateKey(crand.Reader, 2048)
    	if err != nil {
    		fmt.Printf("error generating key: %s n", err)
    		os.Exit(1)
    	}
    
    	// dump private key to file
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 31 14:49:23 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  2. internal/kms/conn.go

    	CreateKey(context.Context, *CreateKeyRequest) error
    
    	ListKeys(context.Context, *ListRequest) ([]madmin.KMSKeyInfo, string, error)
    
    	// GenerateKey generates a new data encryption key using the
    	// key referenced by the key ID.
    	//
    	// The KMS may use a default key if the key ID is empty.
    	// GenerateKey returns an error if the referenced key does
    	// not exist.
    	//
    	// The context is associated and tied to the generated DEK.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Aug 18 06:43:03 UTC 2024
    - 5K bytes
    - Viewed (0)
  3. internal/kms/stub.go

    	if s.containsKeyName(req.Name) {
    		return ErrKeyExists
    	}
    	s.KeyNames = append(s.KeyNames, req.Name)
    	return nil
    }
    
    // GenerateKey is a non-functional stub.
    func (s StubKMS) GenerateKey(_ context.Context, req *GenerateKeyRequest) (DEK, error) {
    	if !s.containsKeyName(req.Name) {
    		return DEK{}, ErrKeyNotFound
    	}
    	return DEK{
    		KeyID:      req.Name,
    		Version:    0,
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Aug 18 06:43:03 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  4. internal/crypto/key.go

    // ObjectKey is a 256 bit secret key used to encrypt the object.
    // It must never be stored in plaintext.
    type ObjectKey [32]byte
    
    // GenerateKey generates a unique ObjectKey from a 256 bit external key
    // and a source of randomness. If random is nil the default PRNG of the
    // system (crypto/rand) is used.
    func GenerateKey(extKey []byte, random io.Reader) (key ObjectKey) {
    	if random == nil {
    		random = rand.Reader
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Mar 19 20:28:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  5. internal/kms/kms.go

    	if req.Prefix == "*" {
    		req.Prefix = ""
    	}
    	return k.conn.ListKeys(ctx, req)
    }
    
    // GenerateKey generates a new data key using the master key req.Name.
    // It returns ErrKeyNotFound if the key does not exist. If req.Name is
    // empty, the KMS default key is used.
    func (k *KMS) GenerateKey(ctx context.Context, req *GenerateKeyRequest) (DEK, error) {
    	if req.Name == "" {
    		req.Name = k.DefaultKey
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Aug 18 06:43:03 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  6. internal/crypto/key_test.go

    	logger.DisableLog = true
    
    	for i, test := range generateKeyTests {
    		i, test := i, test
    		func() {
    			defer recoverTest(i, test.ShouldPass, t)
    			key := GenerateKey(test.ExtKey[:], test.Random)
    			if [32]byte(key) == [32]byte{} {
    				t.Errorf("Test %d: generated key is zero key", i) // check that we generate random and unique key
    			}
    		}()
    	}
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Jul 12 20:51:54 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  7. internal/kms/secret-key.go

    	if req.Name != s.keyID {
    		return ErrNotSupported
    	}
    	return ErrKeyExists
    }
    
    // GenerateKey decrypts req.Ciphertext. The key name req.Name must match the key
    // name of the secretKey.
    //
    // The returned DEK is encrypted using AES-GCM and the ciphertext format is compatible
    // with KES and MinKMS.
    func (s secretKey) GenerateKey(_ context.Context, req *GenerateKeyRequest) (DEK, error) {
    	if req.Name != s.keyID {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Aug 18 06:43:03 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  8. internal/kms/kes.go

    	}
    	return nil
    }
    
    // GenerateKey generates a new data encryption key using
    // the key at the KES server referenced by the key ID.
    //
    // The default key ID will be used if keyID is empty.
    //
    // The context is associated and tied to the generated DEK.
    // The same context must be provided when the generated
    // key should be decrypted.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Aug 18 06:43:03 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  9. cmd/encryption-v1.go

    		if GlobalKMS == nil {
    			return crypto.ObjectKey{}, errKMSNotConfigured
    		}
    		key, err := GlobalKMS.GenerateKey(ctx, &kms.GenerateKeyRequest{
    			AssociatedData: kms.Context{bucket: path.Join(bucket, object)},
    		})
    		if err != nil {
    			return crypto.ObjectKey{}, err
    		}
    
    		objectKey := crypto.GenerateKey(key.Plaintext, rand.Reader)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Oct 13 13:06:08 UTC 2024
    - 37.2K bytes
    - Viewed (0)
  10. internal/kms/secret-key_test.go

    func TestSingleKeyRoundtrip(t *testing.T) {
    	KMS, err := ParseSecretKey("my-key:eEm+JI9/q4JhH8QwKvf3LKo4DEBl6QbfvAl1CAbMIv8=")
    	if err != nil {
    		t.Fatalf("Failed to initialize KMS: %v", err)
    	}
    
    	key, err := KMS.GenerateKey(context.Background(), &GenerateKeyRequest{Name: "my-key"})
    	if err != nil {
    		t.Fatalf("Failed to generate key: %v", err)
    	}
    	plaintext, err := KMS.Decrypt(context.TODO(), &DecryptRequest{
    		Name:       key.KeyID,
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 2.9K bytes
    - Viewed (0)
Back to top