From f448fa8684679a7751e47a766a8ab69cab8e3596 Mon Sep 17 00:00:00 2001 From: cach30verfl0w Date: Fri, 14 Jun 2024 15:24:16 +0200 Subject: [PATCH] Move format into enum package and add keytype enum --- .../keys/{formats => enum}/KeyFormat.kt | 2 +- .../io/karma/advcrypto/keys/enum/KeyType.kt | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) rename kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/{formats => enum}/KeyFormat.kt (98%) create mode 100644 kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/enum/KeyType.kt diff --git a/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/formats/KeyFormat.kt b/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/enum/KeyFormat.kt similarity index 98% rename from kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/formats/KeyFormat.kt rename to kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/enum/KeyFormat.kt index 49ba875..c7362aa 100644 --- a/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/formats/KeyFormat.kt +++ b/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/enum/KeyFormat.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.karma.advcrypto.keys.formats +package io.karma.advcrypto.keys.enum /** * This enum contains all key file/data formats supported by this library. These formats are used to diff --git a/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/enum/KeyType.kt b/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/enum/KeyType.kt new file mode 100644 index 0000000..8d09860 --- /dev/null +++ b/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/keys/enum/KeyType.kt @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Cach30verfl0w + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.karma.advcrypto.keys.enum + +/** + * This enum represents all types of keys. These types are available though the key interface and + * it's implementations. + * + * @author Cedric Hammes + * @since 14/06/2024 + */ +enum class KeyType { + + /** + * This enum value represents a private key type. Private keys are used in signature and + * asymmetric encryption algorithms as a secret hold by the issuer of the key. + * + * @author Cedric Hammes + * @since 14/06/2024 + */ + PRIVATE, + + /** + * This enum value represents a public key type. Public keys are used in signature and + * asymmetric encryption algorithms as public value hold by the issuer and any peer. + * + * @author Cedric Hammes + * @since 14/06/2024 + */ + PUBLIC, + + /** + * This enum value represents a secret key type. Secret keys are used in symmetric encryption + * algorithms as a secret hold by both issuer and peer. + * + * @author Cedric Hammes + * @since 14/06/2024 + */ + SECRET + +} \ No newline at end of file