001package com.nimbusds.jose.jwk; 002 003 004import java.security.KeyPair; 005import java.security.PrivateKey; 006import java.security.PublicKey; 007 008import com.nimbusds.jose.JOSEException; 009 010 011/** 012 * Asymmetric (pair) JSON Web Key (JWK). 013 * 014 * @author Vladimir Dzhuvinov 015 * @version 2015-12-08 016 */ 017public interface AssymetricJWK { 018 019 020 /** 021 * Returns a Java public key representation of the JWK. 022 * 023 * @return The Java public key. 024 * 025 * @throws JOSEException If conversion failed. 026 */ 027 PublicKey toPublicKey() 028 throws JOSEException; 029 030 031 /** 032 * Returns a Java private key representation of this JWK. 033 * 034 * @return The Java private key, {@code null} if not specified. 035 * 036 * @throws JOSEException If conversion failed. 037 */ 038 PrivateKey toPrivateKey() 039 throws JOSEException; 040 041 042 /** 043 * Returns a Java key pair representation of this JWK. 044 * 045 * @return The Java key pair. The private key will be {@code null} if 046 * not specified. 047 * 048 * @throws JOSEException If conversion failed. 049 */ 050 KeyPair toKeyPair() 051 throws JOSEException; 052}