Update activitypub.extend.php
This commit is contained in:
parent
9b21a9ebff
commit
599bd71e7b
|
@ -63,6 +63,26 @@ function activitypub_load_library($name, $callback) {
|
|||
));
|
||||
}
|
||||
|
||||
function activitypub_create_keypair() {
|
||||
$keypair = array('', '');
|
||||
|
||||
$privateKeyResource = openssl_pkey_new(array(
|
||||
'private_key_bits' => 2048,
|
||||
'private_key_type' => OPENSSL_KEYTYPE_RSA
|
||||
));
|
||||
|
||||
// Generate the public key for the private key
|
||||
$privateKeyDetailsArray = openssl_pkey_get_details($privateKeyResource);
|
||||
|
||||
// Export keys to variable
|
||||
$keypair = array($privateKeyResource, $privateKeyDetailsArray['key']);
|
||||
|
||||
// Free the key from memory.
|
||||
openssl_free_key($privateKeyResource);
|
||||
|
||||
return $keypair;
|
||||
}
|
||||
|
||||
function activitypub_get_library_data($name) {
|
||||
global $activitypub_loaded_libraries;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user