类 SmUtils

java.lang.Object
org.cattleframework.security.crypto.SmUtils

public final class SmUtils extends Object
国密工具
作者:
orange
  • 方法详细资料

    • generateSm2CryptoKey

      public static KeyPair generateSm2CryptoKey()
    • getSm2PublicKey

      public static PublicKey getSm2PublicKey(byte[] publicKey)
    • getSm2PrivateKey

      public static PrivateKey getSm2PrivateKey(byte[] privateKey)
    • sm2Encrypt

      public static byte[] sm2Encrypt(byte[] data, org.bouncycastle.crypto.engines.SM2Engine.Mode mode, PublicKey publicKey)
    • sm2Decrypt

      public static byte[] sm2Decrypt(byte[] encryptData, org.bouncycastle.crypto.engines.SM2Engine.Mode mode, PrivateKey privateKey)
    • sm2Sign

      public static byte[] sm2Sign(byte[] data, PrivateKey privateKey)
    • sm2Verify

      public static boolean sm2Verify(byte[] data, PublicKey publicKey, byte[] sign)
    • sm3

      public static byte[] sm3(byte[] data)
    • generateSm4CryptoKey

      public static byte[] generateSm4CryptoKey()
    • generateSm4Iv

      public static byte[] generateSm4Iv(PaddingType paddingType)
    • sm4EncryptCbc

      public static byte[] sm4EncryptCbc(byte[] data, byte[] key, byte[] iv, PaddingType paddingType)
    • sm4DecryptCbc

      public static byte[] sm4DecryptCbc(byte[] encryptData, byte[] key, byte[] iv, PaddingType paddingType)
    • sm4EncryptEcb

      public static byte[] sm4EncryptEcb(byte[] data, byte[] key, PaddingType paddingType)
    • sm4DecryptEcb

      public static byte[] sm4DecryptEcb(byte[] encryptData, byte[] key, PaddingType paddingType)