New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix using SignTool options #156
Conversation
The PR looks good, indeed the simple split by space caused issues when I was experimenting. I like the use of Regarding CRT. The docs say:
My experience is that if I provide a I'd suggest to also look for the case where a certificate file is provided, but no password and then extract the subject via: I'll try to provide the code, but I'll be leaving for a week of travel soon. |
lib/src/sign_tool.dart
Outdated
'the Publisher is the certificate "Subject" in this exact format: "CN=Contoso Software, O=Contoso Corporation, C=US"'); | ||
_logger.stdout('see where you can found your certificate Subject:'); | ||
_logger.stdout( | ||
'https://drive.google.com/file/d/1oAsnrp2Kf-jZ_kaRjyF5llQ0YZy1IwNe/view?usp=sharing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you store the image into this GitHub repository and link to it via a commit url - to make it permanent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done here 1149448
} else if (_config.certificatePath != null && | ||
extension(_config.certificatePath!).toLowerCase() == '.pfx') { | ||
subject = await _getPfxCertificateSubject(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick dry code - have not tested it....
else if (_config.certificatePath != null) {
subject = await _getCrtCertificateSubject();
}
Future<String> _getCrtCertificateSubject() async {
_logger.trace('getting crt certificate Subject');
var certificateDetailsProcess = await _executePowershellCommand(
"new-object System.Security.Cryptography.X509Certificates.X509Certificate2(\"${_config.certificatePath}\") | select -expandproperty Subject -First 1
");
certificateDetailsProcess.exitOnError();
var subject = (certificateDetailsProcess.stdout as String).trim();
return subject;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done here: b252a98
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also added the documentation bc0d17e
Good notes and examples, Thank You! 馃憤 |
Hello @zobo I publish a new version (3.7.0) with these changes:
Thank you! |
Looks like everything is working great. Thank you again! |
Hello @zobo
In this PR I'm trying to fix problems with SignTool.
this PR includes the changes:
About .crt, I don't think SignTool supports .crt files, if I am wrong can you please provide me an example, thanks.
I would appreciate it if you could go through the changes in your spare time 馃憤