-
Notifications
You must be signed in to change notification settings - Fork 5
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
7cbaafd
commit 45c16df
Showing
8 changed files
with
57 additions
and
16 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
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
24 changes: 24 additions & 0 deletions
24
.../io/iohk/atala/prism/walletsdk/domain/models/keyManagement/ExportableImportableKeyTest.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,24 @@ | ||
package io.iohk.atala.prism.walletsdk.domain.models.keyManagement | ||
|
||
import junit.framework.TestCase.assertNull | ||
import org.junit.Test | ||
import kotlin.test.assertEquals | ||
import kotlin.test.assertNotNull | ||
|
||
class ExportableImportableKeyTest { | ||
|
||
@Test | ||
fun testPEMKeyTypeFromString_whenCorrectStringProvided_thenSuccess() { | ||
val keyTypePrivate = PEMKeyType.fromString("-----BEGIN EC PRIVATE KEY-----") | ||
assertNotNull(keyTypePrivate) | ||
assertEquals(PEMKeyType.EC_PRIVATE_KEY, keyTypePrivate) | ||
val keyTypePublic = PEMKeyType.fromString("-----BEGIN EC PUBLIC KEY-----") | ||
assertNotNull(keyTypePublic) | ||
assertEquals(PEMKeyType.EC_PUBLIC_KEY, keyTypePublic) | ||
} | ||
|
||
@Test | ||
fun testPEMKeyTypeFromString_whenWrongStringProvided_thenReturnNull() { | ||
assertNull(PEMKeyType.fromString("-----BEGIN FAIL KEY-----")) | ||
} | ||
} |