gpt4 book ai didi

amazon-web-services - 使用 Google 的 Cloud HSM 签署可执行文件

转载 作者:行者123 更新时间:2023-12-04 17:41:02 24 4
gpt4 key购买 nike

我正在尝试查找一些有关使用 Google's Cloud HSM 的文档签署可执行文件。我找到了一个相当 comprehensive guide for AWS CloudHSM但 AWS 定价(> 1,000 美元/月)对于我们的用例来说似乎要贵几个数量级。

我能否将 AWS 指南(上文)应用于 Google 的 Cloud HSM 基础设施,或者是否有任何我应该注意的重大差异?

最佳答案

根据您的项目和限制,您可以使用 java 的 org.bouncycaslte 进行代码签名操作。

对于 bouncycaSTLe,有一个非常有用的 pdf:https://www.bouncycastle.org/fips-java/BCFipsIn100.pdf

根据您签署可执行文件的方式,ContentSigner.java 提供私钥 API 签名

public class ContentSignerFactory {

public static ContentSigner getContentSigner(Function<ByteArrayOutputStream, byte[]> lambda, String algorithm) {
return new ContentSigner() {
//This is to ensure that signature is created using the right data.
ByteArrayOutputStream stream = new ByteArrayOutputStream();

@Override
public byte[] getSignature() {
//Calling HSM here instead, the stream is the AttributeMap
byte[] data = lambda.apply(stream);
return data;
}

//Perhaps called by BouncyCastle library to provide the content
@Override
public OutputStream getOutputStream() {
return stream;
}

@Override
public AlgorithmIdentifier getAlgorithmIdentifier() {
return new DefaultSignatureAlgorithmIdentifierFinder().find(algorithm);
}
};
}
}

此外,AWS HSM 每年需要 28000 美元,因为它们需要集群 HSM 才能允许自定义 KMS 存储

关于amazon-web-services - 使用 Google 的 Cloud HSM 签署可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54493213/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com