mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-06 19:06:52 +00:00
Revert "Parse the signing cert authority key identifier during signing and place in <KeyName>"
This reverts commit 63e184f9a36d1676f712f711c58e415f4032acf5.
This commit is contained in:
parent
63e184f9a3
commit
74ab262bc0
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user