public static NormalKey createFromSpec(String spec) {
        if (spec == null || !spec.contains(":")) {
            throw new IllegalArgumentException("Invalid spec format");
        }

        String[] parts = spec.split(":", 2);
        if (parts.length != 2) {
            throw new IllegalArgumentException("Invalid spec format");
        }

        String algorithmName = parts[0];
        String base64Key = parts[1];

        EncryptionAlgorithmPB algorithm;
        if (algorithmName.equalsIgnoreCase("AES_128")) {
            algorithm = EncryptionAlgorithmPB.AES_128;
        } else {
            throw new IllegalArgumentException("Unsupported algorithm: " + algorithmName);
        }

        byte[] plainKey;
        try {
            plainKey = Base64.getDecoder().decode(base64Key);
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException("Invalid Base64 key", e);
        }

        if (plainKey.length != 16) {
            throw new IllegalArgumentException("Invalid key length " + plainKey.length * 8);
        }

        return new NormalKey(algorithm, plainKey, null);
    }
@Test
    public void testCreateFromSpec() {
        String base64Key = Base64.getEncoder().encodeToString(normalKey.getPlainKey());
        String spec = "AES_128:" + base64Key;
        NormalKey key = NormalKey.createFromSpec(spec);
        assertNotNull(key);
        assertEquals(EncryptionAlgorithmPB.AES_128, key.getAlgorithm());
        assertArrayEquals(normalKey.getPlainKey(), key.getPlainKey());
    }