Skip to content

how to set the mode of SM2Engine #1302

Description

@jqncc
...
Example: 
Cipher sm2Engine1 = Cipher.getInstance("SM2", "BC");
byte[] m = Strings.toByteArray("encryption standard");
// I want to set SM2Engine.mode=C1C3C2 ?
sm2Engine1.init(Cipher.ENCRYPT_MODE, kp.getPublic(), new TestRandomBigInteger("4C62EEFD6ECFC2B95B92FD6C3D9575148AFA17425546D49018E5388D49DD7B4F", 16));
byte[] enc = sm2Engine1.doFinal(m);
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    support requestCommunity assistance requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions