/* package whatever; // don't place package name! */
import java.util.*;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public class Main {
String keySource
= "qwertyuiopasdfghjklz";
final SecretKeySpec keySpec = new SecretKeySpec(keySource.getBytes(), algo);
final Mac mac = Mac.getInstance(algo);
mac.init(keySpec);
final byte[] signBytes = mac.doFinal(str.getBytes());
String encoded
= Base64.
getEncoder().
encodeToString(signBytes
); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5zZWN1cml0eS5JbnZhbGlkS2V5RXhjZXB0aW9uOwppbXBvcnQgamF2YS5zZWN1cml0eS5Ob1N1Y2hBbGdvcml0aG1FeGNlcHRpb247CmltcG9ydCBqYXZhLnV0aWwuQmFzZTY0OwoKaW1wb3J0IGphdmF4LmNyeXB0by5NYWM7CmltcG9ydCBqYXZheC5jcnlwdG8uc3BlYy5TZWNyZXRLZXlTcGVjOwoKcHVibGljIGNsYXNzIE1haW4gewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgdGhyb3dzIEV4Y2VwdGlvbiB7CiAgICAgICAgU3RyaW5nIGFsZ28gPSAiSE1hY1NIQTEiOwogICAgICAgIFN0cmluZyBrZXlTb3VyY2UgPSAicXdlcnR5dWlvcGFzZGZnaGprbHoiOwogICAgICAgIFN0cmluZyBzdHIgPSAiaG9nZWhvZ2UiOwoKICAgICAgICBmaW5hbCBTZWNyZXRLZXlTcGVjIGtleVNwZWMgPSBuZXcgU2VjcmV0S2V5U3BlYyhrZXlTb3VyY2UuZ2V0Qnl0ZXMoKSwgYWxnbyk7CiAgICAgICAgZmluYWwgTWFjIG1hYyA9IE1hYy5nZXRJbnN0YW5jZShhbGdvKTsKICAgICAgICBtYWMuaW5pdChrZXlTcGVjKTsKICAgICAgICBmaW5hbCBieXRlW10gc2lnbkJ5dGVzID0gbWFjLmRvRmluYWwoc3RyLmdldEJ5dGVzKCkpOwogICAgICAgIFN0cmluZyBlbmNvZGVkID0gQmFzZTY0LmdldEVuY29kZXIoKS5lbmNvZGVUb1N0cmluZyhzaWduQnl0ZXMpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnQoZW5jb2RlZCk7CiAgICB9CQp9