Skip to content

Commit

Permalink
chore: mark TransparentECDSAPublic/PublicKey structures as deprecated…
Browse files Browse the repository at this point in the history
… in KMIP 1.3

Signed-off-by: Pierre-Henri Symoneaux <[email protected]>
  • Loading branch information
phsym committed Jan 31, 2025
1 parent f474f3f commit d1bed38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions kmipclient/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ func (ex ExecRegisterWantType) EcdsaPrivateKey(key *ecdsa.PrivateKey, usage kmip
RecommendedCurve: crv,
}
} else {
//nolint:staticcheck // for backward compatibility
keyMaterial.TransparentECDSAPrivateKey = &kmip.TransparentECDSAPrivateKey{
D: *key.D,
RecommendedCurve: crv,
Expand Down Expand Up @@ -440,6 +441,7 @@ func (ex ExecRegisterWantType) EcdsaPublicKey(key *ecdsa.PublicKey, usage kmip.C
RecommendedCurve: crv,
}
} else {
//nolint:staticcheck // for backward compatibility
keyMaterial.TransparentECDSAPublicKey = &kmip.TransparentECDSAPublicKey{
//nolint:staticcheck // We need this function to marshal public key into its uncompressed form
QString: elliptic.Marshal(key.Curve, key.X, key.Y),
Expand Down
3 changes: 3 additions & 0 deletions objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,10 @@ type TransparentRSAPrivateKey struct {
CRTCoefficient *big.Int
}

// Deprecated: deprecated in KMIP v1.3
type TransparentECDSAPublicKey TransparentECPublicKey

// Deprecated: deprecated in KMIP v1.3
type TransparentECDSAPrivateKey TransparentECPrivateKey

type TransparentECPrivateKey struct {
Expand Down
10 changes: 5 additions & 5 deletions payloads/get_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ var _ kmip.OperationPayload = (*GetAttributesRequestPayload)(nil)
// If no attribute name is specified in the request, all attributes SHALL be deemed to match the Get Attributes request.
// The same attribute name SHALL NOT be present more than once in a request.
type GetAttributesRequestPayload struct {
// Determines the object whose attributes are being requested. If omitted, then the ID Placeholder value is used by the server as the Unique Identifier.
// Determines the object whose attributes are being requested. If omitted, then the ID Placeholder value is used by the server as the Unique Identifier.
UniqueIdentifier *string
// Specifies the name of an attribute associated with the object.
AttributeName []kmip.AttributeName
// Specifies the name of an attribute associated with the object.
AttributeName []kmip.AttributeName
}

// Operation implements kmip.OperationPayload.
Expand All @@ -31,8 +31,8 @@ func (a *GetAttributesRequestPayload) Operation() kmip.Operation {
type GetAttributesResponsePayload struct {
// The Unique Identifier of the object.
UniqueIdentifier string
// The requested attribute associated with the object.
Attribute []kmip.Attribute
// The requested attribute associated with the object.
Attribute []kmip.Attribute
}

var _ kmip.OperationPayload = (*GetAttributesResponsePayload)(nil)
Expand Down

0 comments on commit d1bed38

Please sign in to comment.