Certutil -restrict Error The system cannot find the file specified - certificate

I am trying to get the certificates which are valid within the given date range:-
certutil –view –restrict "NotAfter<=July 31,2013 08:00AM,NotAfter>=July 20,2013 08:00AM" –out "RequestID,RequesterName"
Reference :- http://blogs.technet.com/b/pki/archive/2008/04/24/how-to-determine-all-certificates-that-will-expire-within-30-days.aspx
I get the following error :-
CertUtil: The system cannot find the file specified.
Any help is appreciated.

I was facing the similar kind of problem where while adding the certificate to store using command CertUtil -addStore Mykey.cer was getting the error that
CertUtil: The system cannot find the file specified.
The problem was that is unable to locate the certificate or import it. So to resolve this i followed following things in (Administrator command prompt):--
1.Used ss -root in the end of MakeCert command .
2.Run the CertUtil command from the same location where i runned the makeCert command.

Related

Add list of files to a command

I am not expert on PowerShell so just trying to find way here
I am trying to get a list of files added to a command.
I have a folder full of certs
cert1.p12
cert2.p12
cert3.p12
How do I get these files listed for my command bellow and separated by comma?
CertUtil -p "password1","password2" -MergePFX -user cert1.p12,cert2.p12,cert3.p12 certificate.pfx
Tried searching for a command to add to a straight line with separation

"csr contains no data" when signing CSR on a local instance of Vault on a windows machine

I'm trying to sign an ICA with Vault following this tutorial
And I am the stage where I'm signing the intermediate and I keep getting a "csr contains no data" error, I tried #file, I also tried getting the file contents on a variable and even in-lining the entire file, someone mentioned backticks and online but it doesn't read it properly on the powershell terminal
here is the command I'm using
vault write -format=json rootCA/root/sign-intermediate `
>> issuer_ref="root" `
>> csr=#nt.csr `
>> format=pem_bundle ttl="43800h" `
>> | jq -r ".data.certificate" > int.cert.pem
and the full error
Error writing data to rootCA/root/sign-intermediate: Error making API request.
URL: PUT http://localhost:8200/v1/rootCA/root/sign-intermediate
Code: 400. Errors:
* csr contains no data
EDIT: I used wireshark to investigate the message and if I am using the # notation then I send it with \u0000 between each character...
but if I inline it, it seems fine and yet I still get the error...
I inlined the CSR again, but this time ensuring to keep the new lines...
This worked

Can’t use Mozilla’s cert9.db with certutil.exe

The following command: certutil.exe -L -d “C:\Users\Home\AppData\Roaming\Mozilla\Firefox\Profiles\1bku2z91.default-1633392324717\”
returns this error message: certutil.exe: function failed: SEC_ERROR_LEGACY_DATABASE: The certificate/key database is in an old, unsupported format.
I tried with and without quotes, changed backslash to forward slash. I found comments that the destination folder has to include secmod.db, which my folder does not but I think this applied to cert8.db, not cert9.db. I am passing the right folder as per about:support lookup. My Firefox version is 66.0.3
you need to add "sql:" before the location of the folder to specify that is a sqlite db that you are trying to read so it would be:
certutil.exe -L -d sql:“C:\Users\Home\AppData\Roaming\Mozilla\Firefox\Profiles\1bku2z91.default-1633392324717\”

scp from local to remote - "no such file or directory"

I am attempting to copy a local file to a remote server using scp on my macbook.
I am continuously getting the error "no such file or directory" when I know the file exists(I have checked and rechecked the path). The file has file rwx privileges for u,g and o. The file is not a symlink.
The syntax I am using is:
scp a2.pdf username#remoteserver:~pathto/directory/
The file a2.pdf is in the root directory of my local machine. I have also copied the path exactly as it shows when I use pwd in the directory it is contained it so like this:
scp Users/LocalUsername/a2.pdf username#remoteserver:~pathto/directory/
I am initiating this command while logged into the remote server. The error is given for the local path.
If I attempt to specify localhost information as such:
scp username#localhost:a2.pdf remoteusername#remoteserver:~~pathto/directory/
The prompt I get is to give my localhost password. I try my mac password and I am given permission denied.
I am not sure how to move on from this and any advice would be very much appreciated.
I ran the command from my local machine instead and that fixed the problem. In the local file, I gave the command scp file.txt remoteusername#remoteserver.etc:

Can't create a key of the Subject <'MyCAContainerName'>

using makecert i have written the commade:
makecert -pe -n "CN=Myauthority" -sr localmachine -ss Root -a sha256 -cy authority -r -sk MyCAContainerName -sky exchange -sp "Microsoft RSA Schannel Cryptographic Provider " -sy 12 -len 2048 certif.cer;
i recieved an error
Error: Can't create the key of the Subject <'MyCAContainerName'>
In seeking the solution, I discovered that the problem arises because I did not Authorizations on machineKey file : (C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys ), the
following link explains better what I'm saying;
http://support.microsoft.com/kb/278381
I followed the same procedures in order to have enough permissions to the a machine key, but the problem is always posed
It seems that Can't create the key of the subject is a fairly generic error, however, what follows after it may give a clue.
While it may be caused by permissions errors (e.g. makecert.exe error: Can't create the key of the subject), I have also seen the error of the form Can't create the key of the subject ('<some guid>') caused by an incorrect parameter to the -sp argument.
In your case, Error: Can't create the key of the Subject <'MyCAContainerName'> would make me guess that there is something wrong with the -sk MyCAContainerName portion of the command, but the upshot is, if it is not something with permissions, than it is likely an incorrect command argument or combination of arguments.
Master,
I Ran on the same error. I solved it running command prompt as an administrator user.
MV
Its late but I have the solution to this. First execute the command as you are, it will give the error Error: Can't create the key of the Subject <'MyCAContainerName'>. But it will create a .pvk file. Don't delete it. Instead execute the command again, but this time remove -sk MyCAContainerName from the command. And it will create your certificate.
In my case the C drive did not have enough space. I cleared some unwanted files and folders and it worked.