Is it possible to importKey from a gpg file which is expired? - gnupg

I am trying to validate whether a gpg file got expired or not.
As first step I am trying to get the key of the file using node gpg package
Method: gpg.importKey
As response I am getting error as below
"Error","message":"gpg: invalid armor header
I tried the same for gpg files which is not gona expire for now. Able to get Key in such case.
My question is,
Since the file got expired, gpg.importKey is sending error ?
Any other way to validate the file expiry ?

Related

Getting 403 when trying to push packages to nuget.org

I've been following this document on How to Publish a Package to nuget.org gallery, and I keep getting 403 forbidden.
I've done the following steps:
Browsed to my account in nuget.org.
Clicked on my name -> API Keys
Created an API key as such:
I already have a .nupkg file, so now I try:
$ nuget.exe push .\Test.1.2.3.nupkg -Source https://api.nuget.org/v3/index.json -Apikey <apikey>
And I keep getting:
Pushing Test.1.2.3.nupkg to 'https://www.nuget.org/api/v2/package'...
PUT https://www.nuget.org/api/v2/package/
Forbidden https://www.nuget.org/api/v2/package/ 2238ms
Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have permission to access the specified package.).
Why is that??
The error message said "The specified API key is invalid, has expired, or does not have permission to access the specified package."
You can check this link
If you're using a valid API key that you just created, then this message indicates a naming conflict, which isn't entirely clear from the "permission" part of the error. Change the package identifier, rebuild the project, recreate the .nupkg file, and retry the push command.
Hope it can solve yout problem.

[TOKEN_INVALID]: An invalid token was provided

I'm trying to host a discord bot on Heroku.
When it starts I get this error:
"UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided".
But here is the weird part. It worked fine when I tested it first in Visual Studio Code. So in the process of me getting the files into Heroku, it got invalid.
Does anyone have a clue of how I can fix this?
Thx for any replies in advance.
Deploying app on heroku you have to change you client.login(token) to client.login(process.env.token) and add token to
as token - key and value - token copied from discord developers portal, remember (important note!) letters has to be the same, I mean, if you use capitals in process.env.TOKEN, the config var has to be now TOKEN.
I run into a similar problem, i encrypted the token so that i could store the encrypted token on heroku and decrypt it in the js to pass the actual token to the login method.
The weird part is, if i write the token directly as string into the js file or i use heroku and store it directly there, then it works. But if i store the encrypted token in heroku and decrypt it (and yes it is correctly decrypted) and give the decrypted token to the login method then it does not work.
I dunno if heroku make some weird stuff or discord.js doesnt support something i dont know...
So, what definitly works is:
You insert the token (client secret) on herokus config vars (settings from your dyno), then you use process.env.BOT_TOKEN and pass it to your Discord.Client().login().
I assume in your case its bot.login(process.env.BOT_TOKEN).
So for me it looks like the value i store in heruko and the value i send to discord must be the same...
You should enter a valid Discord bot token. You can obtain it by going to the Discord Developer Portal, then "Applications", select your bot, then go to "Bot" and click "Copy" under the token (it says click here to reveal).
I also encountered this situation.
I discovered that when using dotenv to read data from a .env file (Run on my computer), the names are not case sensitive. (could be wrong)
For example, TOKEN will be able to be treated as token, meaning when process.env.token can be returned with the value of TOKEN in the .env
file
But when I run on Heroku, what I just said will be gone (process.env.token will not return the value of TOKEN, but the token). Try double-checking that the name matches and correct it.
Like you've said, you logged into your bot with bot.login('TOKEN', () => { console.log; }
but bot.login doesn't support callback functions.
What I mean by this is, instead of the code before, you change it to bot.login('TOKEN').

Coinbase API - Having trouble with the signature in API requests

I'm having trouble using the API to send money from one set account into another account via email address for off-chain transactions. There's probably a simple solution to this but I haven't found anything that has worked for me yet despite reading other questions here, basically whenever I make an API request to send money it has an error 401 saying invalid signature.
Following the instructions on the developers page I am making a POST request to the API, and am authenticating the request using an API Key. Everything seems to be working other than the HMAC sha256 signature.
For example let's say that my API key is abc123def456ghi0 and the API secret is 123qwertyuiopasdfghjklzxcvbnm456. Epoch time is 12345678, the method is of course POST, the email I want to send Bitcoin to is me#example.com, the amount is 0.00000015BTC and wallet/account ID is 2bbf394c-193b-5b2a-9155-3b4732659ede.
I make a POST request to https://api.coinbase.com/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions and set the body to type=send&to=me#example.com&amount=0.00000015&currency=BTC
This works fine, the issue I'm having is with the sha256 signature in the header. I'm able to set CB-ACCESS-KEY to abc123def456ghi0 and CB-ACCESS-TIMESTAMP to 12345678, and I'm able to create sha256 signatures easily and sign them with my secret key, I just think I'm putting the wrong text in
Now I have some variables:timestamp: 12345678method: POSTrequestPath: /v2/accounts/1dcea380-77e6-5fd4-8a5b-28c41be39a57/transactionsbody: type=send&to=me#example.com&amount=0.00000015&currency=BTC
On the developers page it says to join the timestamp, method, request path and body in the message. I'm doing this and signing it with my secret key but I still get an error. I'm just a hobbyist so don't have much experience, this is the message I have: 12345678POST/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactionstype=send&to=me#example.com&amount=0.00000015&currency=BTC and then I sign it with my secret key 123qwertyuiopasdfghjklzxcvbnm456
There must be something simple I'm missing, I know all the variables are being joined properly so maybe I have a / somewhere there isn't supposed to be or maybe I need to switch something around, I just know there's a simple solution to this so if anyone could help it would be greatly appreciated.
Sorry - turns out my HMAC sha256 encoder was also encoding into base64. I have fixed this and now it is working.

Get Authorization fail in creating certificate of let's encrypt

I would like to create certificate of let's encrypt.
but I keep getting this error as image.
Can someone help me to give any idea for this?
Thank you.
As it is mentioned in a provided screenshot, the temporary token file, which Let's Encrypt is using to verify the domain name ownership, should be reachable from the net.
In this case, the request from Let's Encrypt servers to this temporary file fails because A record the domain cannot be found.
In other words, it is not possible to get Let's Encrypt certificate while DNS is not properly configured.
Here is the more detailed explanation of the authorization procedure - https://letsencrypt.org/how-it-works/

OrderCloud.io - Change Password issues

I'm developing a app where I need to change the password of the logged in user. where I don't need OrderCloud.PasswordResets() which will send email to my mail. I need to change the password without triggering email.
I followed below approach but I'm getting error:
OrderCloud.Me.Patch({"Password": "1234567889"});
Response:
{"Errors":[ {"ErrorCode":"IdExists","Message":"User already
exists.","Data":null} , {"ErrorCode":"InvalidRequest","Message":"User
already exists.","Data":null} ,
{"ErrorCode":"ServerError","Message":"An unknown error has occurred on
the server.","Data":null} ]}
Request URL:https://api.ordercloud.io/v1/me
Edit: Upon further investigation, this error would be thrown if somehow you have users with duplicate usernames under the same organization. If you remove the duplicate usernames and try again, your issue should be resolved.
You should format your request like this, without the quotes on Password:
OrderCloud.Me.Patch({Password: "1234567889"});

Resources