Class SecurityTestUtils


  • @Beta
    public final class SecurityTestUtils
    extends java.lang.Object
    Beta
    Utilities and constants related to testing the library util package.
    Since:
    1.14
    • Field Detail

      • ENCODED_PRIVATE_KEY

        private static final byte[] ENCODED_PRIVATE_KEY
      • ENCODED_PUBLIC_KEY

        private static final byte[] ENCODED_PUBLIC_KEY
    • Constructor Detail

      • SecurityTestUtils

        private SecurityTestUtils()
    • Method Detail

      • newEncodedRsaPrivateKeyBytes

        public static byte[] newEncodedRsaPrivateKeyBytes()
        Returns a new copy of a sample encoded RSA private key that matches newEncodedRsaPublicKeyBytes().
      • newEncodedRsaPublicKeyBytes

        public static byte[] newEncodedRsaPublicKeyBytes()
        Returns a new copy of a sample encoded public key that matches newEncodedRsaPrivateKeyBytes().
      • newRsaPrivateKey

        public static java.security.interfaces.RSAPrivateKey newRsaPrivateKey()
                                                                       throws java.security.GeneralSecurityException
        Returns a new sample RSA private key that matches newRsaPublicKey().
        Throws:
        java.security.GeneralSecurityException
      • newRsaPublicKey

        public static java.security.interfaces.RSAPublicKey newRsaPublicKey()
                                                                     throws java.security.GeneralSecurityException
        Returns a new sample RSA public key that matches newRsaPrivateKey().
        Throws:
        java.security.GeneralSecurityException