func (kms *GoogleCloudKMS) SigningKeyVersions(ctx context.Context, parent string) ([]SigningKeyVersion, error) {
	results := make([]SigningKeyVersion, 0, 32)

	it := kms.client.ListCryptoKeyVersions(ctx, &kmspb.ListCryptoKeyVersionsRequest{
		Parent:   parent,
		PageSize: 200,
		Filter:   `Filter: "state = ENABLED"`,
	})
	for {
		resp, err := it.Next()
		if errors.Is(err, iterator.Done) {
			break
		}
		if err != nil {
			return nil, fmt.Errorf("failed to list keys: %w", err)
		}

		var key CloudKMSSigningKeyVersion
		key.keyID = resp.Name
		key.keyManager = kms

		if t := resp.GetCreateTime(); t != nil {
			key.createdAt = t.AsTime()
		}
		if t := resp.GetDestroyEventTime(); t != nil {
			key.destroyedAt = t.AsTime()
		}

		results = append(results, &key)
	}

	return results, nil
}
// SigningKeyVersions returns the list of key versions for the parent parsed as
// signing keys.
SigningKeyVersions returns the list of key versions for the parent parsed as
signing keys.
// SigningKeyVersions returns the list of key versions for the parent parsed as // signing keys .
func (kms *GoogleCloudKMS) SigningKeyVersions(ctx context.Context, parent string) ([]SigningKeyVersion, error) {
	results := make([]SigningKeyVersion, 0, 32)
	it := kms.client.ListCryptoKeyVersions(ctx, &kmspb.ListCryptoKeyVersionsRequest{
		Parent:   parent,
		PageSize: 200,
		Filter:   `Filter: "state = ENABLED"`,
	})
	for {
		resp, err := it.Next()
		if errors.Is(err, iterator.Done) {
			break
		}
		if err != nil {
			return nil, fmt.Errorf("failed to list keys: %w", err)
		}
		var key CloudKMSSigningKeyVersion
		key.keyID = resp.Name
		key.keyManager = kms
		if t := resp.GetCreateTime(); t != nil {
			key.createdAt = t.AsTime()
		}
		if t := resp.GetDestroyEventTime(); t != nil {
			key.destroyedAt = t.AsTime()
		}
		results = append(results, &key)
	}
	return results, nil
}
func ( kms * GoogleCloudKMS ) SigningKeyVersions ( ctx context . Context , parent string ) ( [ ] SigningKeyVersion , error ) { results := make ( [ ] SigningKeyVersion , 0 , 32 ) it := kms . client . ListCryptoKeyVersions ( ctx , & kmspb . ListCryptoKeyVersionsRequest { Parent : parent , PageSize : 200 , Filter : `Filter: "state = ENABLED"` , } ) for { resp , err := it . Next ( ) if errors . Is ( err , iterator . Done ) { break } if err != nil { return nil , fmt . Errorf ( " " , err ) } var key CloudKMSSigningKeyVersion key . keyID = resp . Name key . keyManager = kms if t := resp . GetCreateTime ( ) ; t != nil { key . createdAt = t . AsTime ( ) } if t := resp . GetDestroyEventTime ( ) ; t != nil { key . destroyedAt = t . AsTime ( ) } results = append ( results , & key ) } return results , nil }
SigningKeyVersions returns the list of key versions for the parent parsed as
signing keys.
SigningKeyVersions returns the list of key versions for the parent parsed as signing keys .