Loading...
Searching...
No Matches
juce::KeyGeneration Class Reference

## Detailed Description

Contains static utilities for generating key-files that can be unlocked by the OnlineUnlockStatus class.

The documentation for this class was generated from the following file:

- juce_product_unlocking/marketplace/juce_KeyFileGeneration.h

## Static Public Member Functions

static String JUCE_CALLTYPE | generateKeyFile (const String &appName, const String &userEmail, const String &userName, const String &machineNumbers, const RSAKey &privateKey)
| Generates the content of a key-file which can be sent to a user's machine to unlock a product.
static String JUCE_CALLTYPE | generateExpiringKeyFile (const String &appName, const String &userEmail, const String &userName, const String &machineNumbers, const Time expiryTime, const RSAKey &privateKey)
| Similar to the above key file generation method but with an expiry time.
static int | keyGenerationAppMain (int argc, char *argv[])
| This is a simple implementation of a key-generator that you could easily wrap in a command-line main() function for use on your server.

## Member Functions

## generateKeyFile()

String JUCE_CALLTYPE juce::KeyGeneration::generateKeyFile | ( | const String & | appName,
|  | const String & | userEmail,
|  | const String & | userName,
|  | const String & | machineNumbers,
|  | const RSAKey & | privateKey )

static

Generates the content of a key-file which can be sent to a user's machine to unlock a product.

The returned value is a block of text containing an RSA-encoded block, followed by some human-readable details. If you pass this block of text to OnlineUnlockStatus::applyKeyFile(), it will decrypt it, and if the key matches and the machine numbers match, it will unlock that machine.

Typically the way you'd use this on a server would be to build a small executable that simply calls this method and prints the result, so that the webserver can use this as a reply to the product's auto-registration mechanism. The keyGenerationAppMain() function is an example of how to build such a function.

See also
  OnlineUnlockStatus

References JUCE_CALLTYPE.

Referenced by keyGenerationAppMain().

## generateExpiringKeyFile()

String JUCE_CALLTYPE juce::KeyGeneration::generateExpiringKeyFile | ( | const String & | appName,
|  | const String & | userEmail,
|  | const String & | userName,
|  | const String & | machineNumbers,
|  | const Time | expiryTime,
|  | const RSAKey & | privateKey )

static

Similar to the above key file generation method but with an expiry time.

You must supply a Time after which this key file should no longer be considered as active.

N.B. when an app is unlocked with an expiring key file, OnlineUnlockStatus::isUnlocked will still return false. You must then check OnlineUnlockStatus::getExpiryTime to see if this expiring key file is still in date and act accordingly.

See also
  OnlineUnlockStatus

References JUCE_CALLTYPE.

## keyGenerationAppMain()

int juce::KeyGeneration::keyGenerationAppMain | ( | int | argc,
|  | char * | argv[] )

inline static

This is a simple implementation of a key-generator that you could easily wrap in a command-line main() function for use on your server.

So for example you might use this in a command line app called "unlocker" and then call it like this:

unlocker MyGreatApp joebl.nosp@m.oggs.nosp@m.@foob.nosp@m.ar.c.nosp@m.om Joe_Bloggs 1234abcd,95432ff 22d9aec92d986dd1,923ad49e9e7ff294c

References juce::StringArray::add(), generateKeyFile(), and juce::StringArray::size().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited