-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcfe79f
commit 7300956
Showing
17 changed files
with
218 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
VCL/src/main/java/io/velocitycareerlabs/api/VCLSignatureAlgorithm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Created by Michael Avoyan on 08/02/2024. | ||
* | ||
* Copyright 2022 Velocity Career Labs inc. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.velocitycareerlabs.api | ||
|
||
import com.nimbusds.jose.JWSAlgorithm | ||
import com.nimbusds.jose.jwk.Curve | ||
|
||
enum class VCLSignatureAlgorithm(val value: String) { | ||
ES256("P-256"), | ||
SECP256k1("secp256k1"); | ||
|
||
val curve: Curve get() = when(this) { | ||
ES256 -> Curve.P_256 | ||
SECP256k1 -> Curve.SECP256K1 | ||
} | ||
|
||
val jwsAlgorithm: JWSAlgorithm get() = when(this) { | ||
ES256 -> JWSAlgorithm.ES256 | ||
SECP256k1 -> JWSAlgorithm.ES256K | ||
} | ||
|
||
companion object { | ||
fun fromString(value: String) = | ||
when (value) { | ||
ES256.value -> ES256 | ||
SECP256k1.value -> SECP256k1 | ||
else -> ES256 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.