dotnet --version
# => 6.0.101
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.request import Request, urlopen | |
import json | |
import sys | |
req = Request( | |
'https://api.keygen.sh/v1/accounts/demo/licenses/actions/validate-key', | |
method='POST', | |
data=json.dumps({ | |
'meta': { | |
'key': 'C1B6DE-39A6E3-DE1529-8559A0-4AF593-V3', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from "http"; | |
import https from "https"; | |
import { | |
AddressInfo, | |
} from "net"; | |
import { URL } from "url"; | |
const updateServer = "https://updates.yourserver.com/path/to/update/dir/without/trailing/slash"; | |
const updateAuth = `Basic ${Buffer.from("username:password").toString("base64")}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Org.BouncyCastle.Crypto.Signers; | |
using Org.BouncyCastle.Crypto.Engines; | |
using Org.BouncyCastle.Crypto.Digests; | |
using Org.BouncyCastle.Security; | |
using System.Text; | |
using System; | |
class Program | |
{ | |
const string KEYGEN_LICENSE_KEY = "key/eyJhY2NvdW50Ijp7ImlkIjoiMWZkZGNlYzgtOGRkMy00ZDhkLTliMTYtMjE1Y2FjMGY5YjUyIn0sInByb2R1Y3QiOnsiaWQiOiI3MDcxZmVmZi1iNWYzLTQzNGEtODNjMS0zYWIzZjM1OTIzMjUifSwicG9saWN5Ijp7ImlkIjoiOWE0MDI1MTItOGUzZC00YWMxLTkyYjktZTIxMzE3ZDY3MjNjIiwiZHVyYXRpb24iOm51bGx9LCJ1c2VyIjpudWxsLCJsaWNlbnNlIjp7ImlkIjoiYThjODUxMzUtYWM3MS00Y2ZiLWFmZGQtMzEyZTNmNjg5MDM3IiwiY3JlYXRlZCI6IjIwMjEtMDYtMzBUMTE6NTQ6NDAuMTU5WiIsImV4cGlyeSI6bnVsbH19.egtTIhlFr9PfC8mr47wjzac7XbliK9218JM0APCQSonwfUxYWmN_aVILCbzlmxrrp2LtNmuclHEE_Hz6dihrxua1gYl5WtkhVVpsiE58m1ypsbczDnA1QIj-3uhicQt05mnv2MO7zRL335vcCrse_OFwy8QwZtSswsBYnNa_VE0RVjtrwAf4mrWjB5ASqFc9d-44u2c7R0VVB8ODF0A7telSa9ZbHOkl8gborW45SQT0GLqCK3a1NvHmX_nJ9PR3N8RfHsa3cblmOlsOA-7VCyoJulNdbpwo1xItO28oCOvoqV2P9XDhqfKBEMgyUhgdm_yml3ezJPjfL8l6S-shxw=="; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cryptography.hazmat.primitives import serialization, hashes | |
from cryptography.hazmat.primitives.asymmetric import padding | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.exceptions import InvalidSignature | |
import base64 | |
import sys | |
import os | |
# Cryptographically verify the activation proof using our public key | |
def verify_activation_proof(activation_proof): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Org.BouncyCastle.Crypto.Signers; | |
using Org.BouncyCastle.Crypto.Engines; | |
using Org.BouncyCastle.Crypto.Digests; | |
using Org.BouncyCastle.Security; | |
using System.Text; | |
using System; | |
class Program | |
{ | |
const string KEYGEN_ACTIVATION_PROOF = "proof/eyJhY2NvdW50Ijp7ImlkIjoiYjEyMmRmN2MtN2UzNi00NjNiLTlhYzMtYzkzZmYzOGIzMTFmIn0sInByb2R1Y3QiOnsiaWQiOiJiZWZlMjBjMS05MTE4LTQ2MmMtYWFhNS0yMWE2MmUxNmU5NWEifSwicG9saWN5Ijp7ImlkIjoiYTg2YWU0NmUtMTQzMS00ZDVjLWJkNzUtN2YzODNlZDY4YjA2IiwiZHVyYXRpb24iOjg2NDAwfSwibGljZW5zZSI6eyJpZCI6IjI2MzhiZWFmLTIwMWMtNDg5ZS1iODA2LTRhOWEwN2ZhYzA4OSIsImtleSI6ImtleS9ORlJMUmkwMFYxWlNMVlZHTkZndE4xZElTQzFOVkZsTUxWWktXRTR0TjAwelJpMVFVbGRTLm5UMXBENFA2OUFnVTNVa0x3eFlLU19RNU03RHV3ekZtZ0pDOWd2N1ZGUmNiWkxJYUZsSVktY2hMbnEtUTNNUVk1dlUydURobHNXUkhfQnBHRkVITDZxcFIzQ1otX2lVYmdoU2pBM1FiNl80RVVhcjBTMlhsd2d2ZHUyVFJHTGRkRG52cTBaOGEtak1vRmpnc1RVVzZqZG5yR1NBQUNFQkNHX0I0QkVQWTN2MEVBeE5GUTJRU1RwUE1jbFhhTGlKWlZIa0NSSGhQdWI5T0NmN0JTWTVUWWhFLVoxeGVrQ29teXppQlFlWEpVMjJ6MnJqZHVhMEk4WUNvdWJkbkNoUDNtdjI3SWxsQUREaHZpYW1oSHAxNnB5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto') | |
{ | |
const verifyKey = 'e8601e48b69383ba520245fd07971e983d06d22c4257cfd82304601479cee788' | |
const licenseKey = 'key/Njg1ZjkwMDY5OGZkOWNiZTYwODRlNmRhZDdmMGU3NjI=.V0MIuqrUfTnPrCAPqi8YfnpGHNluoGs1QG0XqZ67D8q9dQvtuEaKVz_7w5cZkcYvOkNbvE28w8P4xVemXbBqAA==' | |
// Encode hexidecimal key into DER format (Node doesn't accept hex format) | |
const oid = Buffer.from([0x06, 0x03, 0x2B, 0x65, 0x70]) | |
const key = Buffer.from(verifyKey, 'hex') | |
const elements = Buffer.concat([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Serializer outputs ---------------------------------- | |
alba {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]} | |
alba_inline {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]} | |
ams {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]} | |
blueprinter {"body":"post","commenter_names":["John","Jane"],"comments":[{"body":"Comment1","id":1},{"body":"Comment2","id":2}],"id":1} | |
jbuilder {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]} | |
jsonapi {"data":{"id":"1","type":"json_api_standard_post","attributes":{"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body" |