Mac

protected expect constructor(algorithm: String, engine: Mac.Engine)(source)

Creates a new Mac for the specified parameters.

Parameters

algorithm
engine

See Engine

Throws

IllegalArgumentException

when:


protected expect constructor(other: Mac)(source)

Creates a new Mac from other, copying its Engine and state.

Implementors of Mac should have a private secondary constructor that is utilized by its copy implementation.

e.g.

public class HmacSHA256: Mac {

    // ...

    private constructor(other: HmacSHA256): super(other) {
        // Copy implementation details...
    }

    // Notice the updated return type
    public override fun copy(): HmacSHA256 = HmacSHA256(this)

    // ...
}
protected actual constructor(algorithm: String, engine: Mac.Engine)(source)

Creates a new Mac for the specified parameters.

Parameters

algorithm
engine

See Engine

Throws

IllegalArgumentException

when:


protected actual constructor(other: Mac)(source)

Creates a new Mac from other, copying its Engine and state.

Implementors of Mac should have a private secondary constructor that is utilized by its copy implementation.

e.g.

public class HmacSHA256: Mac {

    // ...

    private constructor(other: HmacSHA256): super(other) {
        // Copy implementation details...
    }

    // Notice the updated return type
    public override fun copy(): HmacSHA256 = HmacSHA256(this)

    // ...
}
protected actual constructor(algorithm: String, engine: Mac.Engine)(source)

Creates a new Mac for the specified parameters.

Parameters

algorithm
engine

See Engine

Throws

IllegalArgumentException

when:


protected actual constructor(other: Mac)(source)

Creates a new Mac from other, copying its Engine and state.

Implementors of Mac should have a private secondary constructor that is utilized by its copy implementation.

e.g.

public class HmacSHA256: Mac {

    // ...

    private constructor(other: HmacSHA256): super(other) {
        // Copy implementation details...
    }

    // Notice the updated return type
    public override fun copy(): HmacSHA256 = HmacSHA256(this)

    // ...
}