mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
finish Component: Signature
This commit is contained in:
1 parent
abaf0dda4a
commit
ff3c622cba
1 file changed
+28
@@ -0,0 +1,28 @@
|
||||
package component;
|
||||
|
||||
import minsecurity.identity.Identity;
|
||||
|
||||
/*
|
||||
* @Author: Wang Feng
|
||||
* @Description: 根据签名值类型创建一个 SignatureInfo
|
||||
* @Version: 1.0.0
|
||||
* @Date: 20:54 2021/3/15
|
||||
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
||||
*/
|
||||
public class Signature {
|
||||
private SignatureInfo sigInfo;
|
||||
private SignatureValue sigValue;
|
||||
|
||||
/**
|
||||
* 根据网络身份创建一个 Signature
|
||||
* @param identity
|
||||
* @param value
|
||||
*/
|
||||
public Signature(Identity identity,byte[] value){
|
||||
// 往包中添加签名
|
||||
KeyLocator keyLocator=new KeyLocator(identity.getName());
|
||||
this.sigInfo=new SignatureInfo(
|
||||
new SignatureAlgorithm(identity.getKeyParam().SignatureAlgorithm),keyLocator);
|
||||
this.sigValue=new SignatureValue(value);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user