Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add digest to interface #159

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ enum class RSAPadding {
}

sealed interface SignatureAlgorithm {

val digest: Digest?

data class HMAC(
/** The digest to use */
val digest: Digest
override val digest: Digest
) : SignatureAlgorithm

data class ECDSA(
/** The digest to apply to the data, or `null` to directly process the raw data. */
val digest: Digest?,
override val digest: Digest?,
/** Whether this algorithm specifies a particular curve to use, or `null` for any curve. */
val requiredCurve: ECCurve?
) : SignatureAlgorithm

data class RSA(
/** The digest to apply to the data. */
val digest: Digest,
override val digest: Digest,
/** The padding to apply to the data. */
val padding: RSAPadding
) : SignatureAlgorithm
Expand Down
Loading