// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"

	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)

// V1alpha1Jwk JWK represents:
// - a JSON Web Key (JWK) with the respective fields specific to RSA algorithms.
// - a Quantum JSON Web Key (QJWK) with the respective fields specific to AKP algorithms.
//
// swagger:model v1alpha1Jwk
type V1alpha1Jwk struct {

	// ALG represents the algorithm intended for use with the key.
	// Example algorithms for Post-Quantum ML-DSA family:
	// "ML-DSA-44", "ML-DSA-65", "ML-DSA-87".
	// Some example algorithms are "RS256", "RS384", "RS512" for RSA algorithms.
	Alg string `json:"alg,omitempty"`

	// The private exponent for the RSA kty.
	D string `json:"d,omitempty"`

	// The first factor CRT exponent for the RSA private key.
	Dp string `json:"dp,omitempty"`

	// The second factor CRT exponent for the RSA private key.
	Dq string `json:"dq,omitempty"`

	// The exponent for the RSA public key.
	E string `json:"e,omitempty"`

	// KID represents the key ID.
	// It is used to match a specific key.
	Kid string `json:"kid,omitempty"`

	// KTY represents the key type parameter.
	// It specifies the family of quantum algorithms used with the key,
	// such as "AKP" for post quantum algorithms
	// or "RSA" for non quantum algorithms.
	Kty string `json:"kty,omitempty"`

	// The modulus for the RSA public key.
	N string `json:"n,omitempty"`

	// The first prime factor for the RSA private key.
	P string `json:"p,omitempty"`

	// The private key for the AKP kty.
	Priv string `json:"priv,omitempty"`

	// The public key for the AKP kty.
	Pub string `json:"pub,omitempty"`

	// The second prime factor for the RSA private key.
	Q string `json:"q,omitempty"`

	// The first CRT coefficient for the RSA private key.
	Qi string `json:"qi,omitempty"`

	// Seed used to derive keys for ML-DSA alg.
	Seed string `json:"seed,omitempty"`

	// Use represents the intended use of the key.
	// Some example values are "enc" and "sig".
	Use string `json:"use,omitempty"`
}

// Validate validates this v1alpha1 jwk
func (m *V1alpha1Jwk) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this v1alpha1 jwk based on context it is used
func (m *V1alpha1Jwk) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (m *V1alpha1Jwk) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *V1alpha1Jwk) UnmarshalBinary(b []byte) error {
	var res V1alpha1Jwk
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
