File tree Expand file tree Collapse file tree 5 files changed +31
-0
lines changed
hmac/src/commonMain/kotlin/org/kotlincrypto/macs
hmac-md5/src/commonMain/kotlin/org/kotlincrypto/macs
hmac-sha1/src/commonMain/kotlin/org/kotlincrypto/macs
hmac-sha2-256/src/commonMain/kotlin/org/kotlincrypto/macs
hmac-sha2-512/src/commonMain/kotlin/org/kotlincrypto/macs Expand file tree Collapse file tree 5 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ import org.kotlincrypto.hash.Md5
23
23
24
24
public class HmacMD5 : Hmac {
25
25
26
+ /* *
27
+ * Instantiates a new instance of [HmacMD5].
28
+ *
29
+ * @throws [IllegalArgumentException] if [key] is empty.
30
+ * */
26
31
@OptIn(InternalKotlinCryptoApi ::class )
27
32
@Throws(IllegalArgumentException ::class )
28
33
public constructor (key: ByteArray ): super (key, " HmacMD5" , Md5 ())
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ import org.kotlincrypto.hash.Sha1
23
23
24
24
public class HmacSHA1 : Hmac {
25
25
26
+ /* *
27
+ * Instantiates a new instance of [HmacSHA1].
28
+ *
29
+ * @throws [IllegalArgumentException] if [key] is empty.
30
+ * */
26
31
@OptIn(InternalKotlinCryptoApi ::class )
27
32
@Throws(IllegalArgumentException ::class )
28
33
public constructor (key: ByteArray ): super (key, " HmacSHA1" , Sha1 ())
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ import org.kotlincrypto.hash.Sha256
23
23
24
24
public class HmacSHA256 : Hmac {
25
25
26
+ /* *
27
+ * Instantiates a new instance of [HmacSHA256].
28
+ *
29
+ * @throws [IllegalArgumentException] if [key] is empty.
30
+ * */
26
31
@OptIn(InternalKotlinCryptoApi ::class )
27
32
@Throws(IllegalArgumentException ::class )
28
33
public constructor (key: ByteArray ): super (key, " HmacSHA256" , Sha256 ())
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ import org.kotlincrypto.hash.Sha512
23
23
24
24
public class HmacSHA512 : Hmac {
25
25
26
+ /* *
27
+ * Instantiates a new instance of [HmacSHA512].
28
+ *
29
+ * @throws [IllegalArgumentException] if [key] is empty.
30
+ * */
26
31
@OptIn(InternalKotlinCryptoApi ::class )
27
32
@Throws(IllegalArgumentException ::class )
28
33
public constructor (key: ByteArray ): super (key, " HmacSHA512" , Sha512 ())
Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ import kotlin.jvm.JvmSynthetic
32
32
* */
33
33
public abstract class Hmac : Mac {
34
34
35
+ /* *
36
+ * Primary constructor for creating a new [Hmac] instance
37
+ *
38
+ * @throws [IllegalArgumentException] if [key] is empty.
39
+ * */
35
40
@InternalKotlinCryptoApi
36
41
@Throws(IllegalArgumentException ::class )
37
42
protected constructor (
@@ -40,6 +45,12 @@ public abstract class Hmac: Mac {
40
45
digest: Digest ,
41
46
): super (algorithm, Engine .instance(key, digest))
42
47
48
+ /* *
49
+ * Secondary constructor for implementing [copy].
50
+ *
51
+ * Implementors of [Hmac] should have a private secondary constructor
52
+ * that is utilized by its [copy] implementation.
53
+ * */
43
54
@InternalKotlinCryptoApi
44
55
protected constructor (
45
56
algorithm: String ,
You can’t perform that action at this time.
0 commit comments