use of com.github.zhenwei.pkix.util.asn1.cms.OriginatorPublicKey in project LinLong-Java by zhenwei1108.
the class KeyAgreeRecipientInformation method getSenderPublicKeyInfo.
private SubjectPublicKeyInfo getSenderPublicKeyInfo(AlgorithmIdentifier recKeyAlgId, OriginatorIdentifierOrKey originator) throws CMSException, IOException {
OriginatorPublicKey opk = originator.getOriginatorKey();
if (opk != null) {
return getPublicKeyInfoFromOriginatorPublicKey(recKeyAlgId, opk);
}
OriginatorId origID;
IssuerAndSerialNumber iAndSN = originator.getIssuerAndSerialNumber();
if (iAndSN != null) {
origID = new OriginatorId(iAndSN.getName(), iAndSN.getSerialNumber().getValue());
} else {
SubjectKeyIdentifier ski = originator.getSubjectKeyIdentifier();
origID = new OriginatorId(ski.getKeyIdentifier());
}
return getPublicKeyInfoFromOriginatorId(origID);
}
Aggregations