(accessControl())
Operations related to access control/signing keys api
- create - Create a signing key
- getAll - Retrieves signing keys
- delete - Delete Signing Key
- get - Retrieves a signing key
- update - Update a signing key
The publicKey is a representation of the public key, encoded as base 64 and is passed as a string, and the privateKey is displayed only on creation. This is the only moment where the client can save the private key, otherwise it will be lost. Remember to decode your string when signing JWTs.
Up to 10 signing keys can be generated, after that you must delete at least one signing key to create a new one.
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.CreateSigningKeyResponse;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
CreateSigningKeyResponse res = sdk.accessControl().create()
.call();
if (res.signingKey().isPresent()) {
// handle response
}
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
CreateSigningKeyResponse
Error Object |
Status Code |
Content Type |
models/errors/SDKError |
4xx-5xx |
*/* |
Retrieves signing keys
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.GetSigningKeysResponse;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetSigningKeysResponse res = sdk.accessControl().getAll()
.call();
if (res.data().isPresent()) {
// handle response
}
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
GetSigningKeysResponse
Error Object |
Status Code |
Content Type |
models/errors/SDKError |
4xx-5xx |
*/* |
Delete Signing Key
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.DeleteSigningKeyResponse;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
DeleteSigningKeyResponse res = sdk.accessControl().delete()
.keyId("<value>")
.call();
// handle response
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter |
Type |
Required |
Description |
keyId |
String |
✔️ |
ID of the signing key |
DeleteSigningKeyResponse
Error Object |
Status Code |
Content Type |
models/errors/SDKError |
4xx-5xx |
*/* |
Retrieves a signing key
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.GetSigningKeyResponse;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetSigningKeyResponse res = sdk.accessControl().get()
.keyId("<value>")
.call();
if (res.signingKey().isPresent()) {
// handle response
}
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter |
Type |
Required |
Description |
keyId |
String |
✔️ |
ID of the signing key |
GetSigningKeyResponse
Error Object |
Status Code |
Content Type |
models/errors/SDKError |
4xx-5xx |
*/* |
Update a signing key
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.UpdateSigningKeyRequestBody;
import studio.livepeer.livepeer.models.operations.UpdateSigningKeyResponse;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
UpdateSigningKeyResponse res = sdk.accessControl().update()
.keyId("<value>")
.requestBody(UpdateSigningKeyRequestBody.builder()
.build())
.call();
// handle response
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
UpdateSigningKeyResponse
Error Object |
Status Code |
Content Type |
models/errors/SDKError |
4xx-5xx |
*/* |