Jump to content

Recommended Posts

Posted

It is the fruit of my last job.
You can easily manage certificates in Windows.

 

Still beta so please make a comment.

Regards,
mLipok

 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

I was busy and for this reason as for now, I made such a poor documentation.
Currently I want to present example with comments:

Global $__g_bCertTestingExample = (Not @Compiled) And (@ScriptName = 'CertUtil.au3')
If $__g_bCertTestingExample Then _CertUtil_Example()
Func _CertUtil_Example()
    If $__g_bCertTestingExample Then _DebugSetup()

    ; Get list of "Polish Certyfication Centers" form "National Certyfication Center"
    Local $dData = InetRead('https://www.nccert.pl/zaswiadczenia.htm', $INET_FORCERELOAD)
    Local $iBytesRead = @extended

    ; Convert the ANSI compatible binary string back into a string.
    Local $sData = BinaryToString($dData)

    ; Find only QCA *.crt or *.cer files
    Local $aFiles = StringRegExp($sData, '(?is)href="files/(.{1,20}QCA.{0,20}.c[ert]{2})"', $STR_REGEXPARRAYGLOBALMATCH)

    Local $sFileToDownload = ''
    Local $sFileFullPath_LocalDest = ''

    For $iFile_idx = 0 To UBound($aFiles) - 1
        $sFileToDownload = $aFiles[$iFile_idx]
        ; Download QCA *.crt or *.cer files
        _CertUtil_ExampleDownload($sFileToDownload)
        $sFileFullPath_LocalDest = @ScriptDir & '\' & StringReplace($sFileToDownload, '%20', ' ')
        ; Add downloaded QCA file to the " Windows Certification Storage"
        _CertUtil_addstore('-enterprise CA', $sFileFullPath_LocalDest)
    Next

EndFunc    ;==>_CertUtil_Example

 

Edited by mLipok
fixing typo QCQ >> QCA

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 2 months later...
Posted

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 4 months later...
Posted

:) nice work

Some documentation suggestions: 

Update header

; #INDEX# ========================================================================
; Title .........: CertUtil.au3
; AutoIt Version : 3.3.10.2++
; Language ......: English
; Description ...: A collection of Function for use with an CertUtil.exe
; Author ........: mLipok
; Modified ......:
; URL ...........: http://www.autoitscript.com/forum/.......
; Date ..........: 2016/10/18
; Version .......: 0.0.1 BETA - Work in progress
; Support topic..: https://www.autoitscript.com/forum/topic/184937-certutil-udf-support-topic/
; Download ......: https://www.autoitscript.com/forum/files/file/421-certutil-udf/
; ================================================================================

add function

; #FUNCTION# ====================================================================================================================
; Name ..........: _CertUtil_UDFVersion
; Description ...: Get ADO UDFVersion number
; Syntax ........: _CertUtil_UDFVersion()
; Parameters ....: none
; Return values .: UDF Version
; Author ........: mLipok
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _CertUtil_UDFVersion()
    Return '0.0.1 BETA CertUtil.au3 UDF'
EndFunc   ;==>_CertUtil_UDFVersion

Run Tidy on all :)

Skysnake

Skysnake

Why is the snake in the sky?

Posted

Should the example in post #2 replace the same function in the UDF or is this an additional example?

I like the scrolling debug window :)

Skysnake

 

Skysnake

Why is the snake in the sky?

  • 10 months later...
Posted

Today @tungpheng asked "How to View the Contents of a Certificate" 

 

Here is a solution:

  Quote

2018/03/26
.    Added: Function: _CertUtil_ConvertToBinary() - mLipok
.    Added: Function: _CertUtil_Dump() - mLipok
.    Added: Enums: $CUTIL_EXT_PARAM1, $CUTIL_EXT_PARAM2, $CUTIL_EXT_PARAM3 - mLipok
.    Added: Enum: $CUTIL_ERR_FILE_EXISTS - mLipok
 

Expand  

Download:

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 1 year later...
Posted

Hi mLipok,

I'm not too savvy about code signing stuff and want to experiment with just a cer file
 to convert it to other files needed to code signing files

if by chance you are familiar with any of these OpenSSL commands @ the bottom of this page

or better yet recommend where to look or what udf can be useful for this

.cer to .pem >
.pem to .pfx >
.spc ..
.pvk ..

Thanks

Posted

Just install OpenSSL and you can do any automation with the stuff mentioned in the page you provide.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...