Revert "Parse the signing cert authority key identifier during signing and place in <KeyName>"

This reverts commit 63e184f9a36d1676f712f711c58e415f4032acf5.
This commit is contained in:
chubtub 2024-02-29 10:43:11 -05:00
parent 63e184f9a3
commit 74ab262bc0
2 changed files with 6 additions and 8 deletions

View File

@ -278,19 +278,17 @@ public class CredentialParser {
}
/**
* This method returns the authorityKeyIdentifier from the local X509Certificate.
* @return the String representation of the AKI
* This method returns the subjectKeyIdentifier from the local X509Certificate.
* @return the String representation of the subjectKeyIdentifier
* @throws IOException
*/
public String getCertificateAuthorityKeyIdentifier() throws IOException {
public String getCertificateSubjectKeyIdentifier() throws IOException {
String decodedValue = null;
byte[] extension = certificate.getExtensionValue(Extension.authorityKeyIdentifier.getId());
byte[] extension = certificate.getExtensionValue(Extension.subjectKeyIdentifier.getId());
if (extension != null && extension.length > 0) {
decodedValue = JcaX509ExtensionUtils.parseExtensionValue(extension).toString();
}
//decodedValue above is of the form [[CONTEXT 0]#e0f...], parse out the extraneous chars
decodedValue = decodedValue.substring(decodedValue.indexOf("#")+1,decodedValue.length()-1);
return decodedValue;
return decodedValue.substring(1);//Drop the # at the beginning of the string
}
/**

View File

@ -646,7 +646,7 @@ public class SwidTagGateway {
}
}
try {
KeyName keyName = kiFactory.newKeyName(cp.getCertificateAuthorityKeyIdentifier());
KeyName keyName = kiFactory.newKeyName(cp.getCertificateSubjectKeyIdentifier());
keyInfoElements.add(keyName);
} catch (IOException e) {
System.out.println("Error while getting SKID: " + e.getMessage());