diff --git a/library/error/api/error.klib.api b/library/error/api/error.klib.api index 6b43eba..9cf26c2 100644 --- a/library/error/api/error.klib.api +++ b/library/error/api/error.klib.api @@ -68,5 +68,12 @@ open class org.kotlincrypto.error/ShortBufferException : org.kotlincrypto.error/ constructor (kotlin/String?) // org.kotlincrypto.error/ShortBufferException.|(kotlin.String?){}[0] } +open class org.kotlincrypto.error/SignatureException : org.kotlincrypto.error/GeneralSecurityException { // org.kotlincrypto.error/SignatureException|null[0] + constructor () // org.kotlincrypto.error/SignatureException.|(){}[0] + constructor (kotlin/String?) // org.kotlincrypto.error/SignatureException.|(kotlin.String?){}[0] + constructor (kotlin/String?, kotlin/Throwable?) // org.kotlincrypto.error/SignatureException.|(kotlin.String?;kotlin.Throwable?){}[0] + constructor (kotlin/Throwable?) // org.kotlincrypto.error/SignatureException.|(kotlin.Throwable?){}[0] +} + final inline fun org.kotlincrypto.error/requireParam(kotlin/Boolean) // org.kotlincrypto.error/requireParam|requireParam(kotlin.Boolean){}[0] final inline fun org.kotlincrypto.error/requireParam(kotlin/Boolean, kotlin/Function0) // org.kotlincrypto.error/requireParam|requireParam(kotlin.Boolean;kotlin.Function0){}[0] diff --git a/library/error/src/commonMain/kotlin/org/kotlincrypto/error/SignatureException.kt b/library/error/src/commonMain/kotlin/org/kotlincrypto/error/SignatureException.kt new file mode 100644 index 0000000..526d45b --- /dev/null +++ b/library/error/src/commonMain/kotlin/org/kotlincrypto/error/SignatureException.kt @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 KotlinCrypto + * + * 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 + * + * https://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. + **/ +@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") + +package org.kotlincrypto.error + +/** + * The `SignatureException` class is a generic security exception class that provides type safety + * for all the signature-related exception classes that extend from it. + * */ +public expect open class SignatureException: GeneralSecurityException { + public constructor() + public constructor(message: String?) + public constructor(message: String?, cause: Throwable?) + public constructor(cause: Throwable?) +} diff --git a/library/error/src/jvmMain/kotlin/org/kotlincrypto/error/JvmExceptions.kt b/library/error/src/jvmMain/kotlin/org/kotlincrypto/error/JvmExceptions.kt index ff00aea..a77e574 100644 --- a/library/error/src/jvmMain/kotlin/org/kotlincrypto/error/JvmExceptions.kt +++ b/library/error/src/jvmMain/kotlin/org/kotlincrypto/error/JvmExceptions.kt @@ -27,3 +27,4 @@ public actual typealias IllegalBlockSizeException = javax.crypto.IllegalBlockSiz public actual typealias KeyException = java.security.KeyException public actual typealias InvalidKeyException = java.security.InvalidKeyException public actual typealias ShortBufferException = javax.crypto.ShortBufferException +public actual typealias SignatureException = java.security.SignatureException diff --git a/library/error/src/nonJvmMain/kotlin/org/kotlincrypto/error/SignatureException.kt b/library/error/src/nonJvmMain/kotlin/org/kotlincrypto/error/SignatureException.kt new file mode 100644 index 0000000..71cd3cf --- /dev/null +++ b/library/error/src/nonJvmMain/kotlin/org/kotlincrypto/error/SignatureException.kt @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 KotlinCrypto + * + * 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 + * + * https://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. + **/ +@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") + +package org.kotlincrypto.error + +/** + * The `SignatureException` class is a generic security exception class that provides type safety + * for all the signature-related exception classes that extend from it. + * */ +public actual open class SignatureException: GeneralSecurityException { + public actual constructor(): super() + public actual constructor(message: String?): super(message) + public actual constructor(message: String?, cause: Throwable?): super(message, cause) + public actual constructor(cause: Throwable?): super(cause) +}