我正在尝试使用codenameone BouncyCastle lib加密ISO-0 pinblock.我用来实现这个的方法如下:
private static byte[] performEncrypt(byte[] key, String plainText, boolean padding) {
byte[] ptBytes = plainText.getBytes();
BufferedBlockCipher cipher;
if (padding) {
cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new DESedeEngine()));
} else {
cipher = new BufferedBlockCipher(new CBCBlockCipher(new DESedeEngine()));
}
cipher.init(true, new KeyParameter(key));
byte[] rv = new byte[cipher.getOutputSize(ptBytes.length)];
int oLen = cipher.processBytes(ptBytes, 0, ptBytes.length, rv, 0);
try {
cipher.doFinal(rv, oLen);
} catch (CryptoException ce) {
LoggingUtil.error(TAG, ce, "Unexpected Exception");
}
return rv;
}
private static String createIso0PinBlock(String pin, String number) { …Run Code Online (Sandbox Code Playgroud) 我想在 Vaadin 中更改与 Springboot 结合的网站的 favicon。我还选择在 Vaadin 中采用纯 Java 路线(无 html 页面)。
我遵循了这个指南,它解释了我希望使用的图标应该添加到src/main/webapp/icons文件夹中,在那里它会被自动拾取、调整大小等。
我试过无济于事,之后我发现这个线程,然后这一个。后一个链接特别说明了 Spring-boot 有自己的目录,webapp应该避免使用该文件夹。我尝试使用 spring 目录,但再次无济于事。
我的资源文件夹目前看起来是这样的:
我的 MainView 是这样的:
@Route
@PageTitle("My new title")
public class MainView extends VerticalLayout {
Run Code Online (Sandbox Code Playgroud)
我的SpringBootApplication班级是这样的:
@SpringBootApplication
public class MyVaadinApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(MyVaadinApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
图标仍然是默认的弹簧叶:
尝试设置网站图标时我哪里出错了?
java ×2
android ×1
bouncycastle ×1
codenameone ×1
encryption ×1
favicon ×1
icons ×1
spring-boot ×1
vaadin ×1