PublicKey
Representation of Subject Public Key Info
Extends
PemData
<SubjectPublicKeyInfo
>
Constructors
new PublicKey()
new PublicKey(
asn
):PublicKey
Creates a new instance from ASN.1
Parameters
asn
SubjectPublicKeyInfo
ASN.1 object
Returns
Overrides
new PublicKey()
new PublicKey(
raw
):PublicKey
Creates a new instance
Parameters
raw
Encoded buffer (DER, PEM, HEX, Base64, Base64Url)
Returns
Overrides
Properties
algorithm
algorithm:
Algorithm
Gets a key algorithm
rawData
readonly
rawData:ArrayBuffer
Gets a DER encoded buffer
Inherited from
tag
protected
readonly
tag:string
PEM tag
Overrides
NAME
static
NAME:string
="ASN"
Inherited from
Methods
equal()
equal(
data
):data is PublicKey
Returns true
if ASN.1 data is equal to another ASN.1 data, otherwise false
Parameters
data
any
Any data
Returns
data is PublicKey
Inherited from
export()
Call Signature
export(
crypto
?):Promise
<CryptoKey
>
Returns a public CryptoKey
Parameters
crypto?
Crypto
Crypto provider. Default is from CryptoProvider
Returns
Promise
<CryptoKey
>
Call Signature
export(
algorithm
,keyUsages
,crypto
?):Promise
<CryptoKey
>
Returns a public CryptoKey with specified parameters
Parameters
algorithm
Algorithm
Algorithm
| RsaHashedImportParams
| EcKeyImportParams
keyUsages
KeyUsage
[]
A list of key usages
crypto?
Crypto
Crypto provider. Default is from CryptoProvider
Returns
Promise
<CryptoKey
>
getKeyIdentifier()
Call Signature
getKeyIdentifier(
crypto
?):Promise
<ArrayBuffer
>
Returns Subject Key Identifier as specified in RFC5280
Parameters
crypto?
Crypto
Crypto provider. Default is from CryptoProvider
Returns
Promise
<ArrayBuffer
>
Call Signature
getKeyIdentifier(
algorithm
,crypto
?):Promise
<ArrayBuffer
>
Returns Subject Key Identifier for specified algorithm
Parameters
algorithm
AlgorithmIdentifier
Hash algorithm
crypto?
Crypto
Crypto provider. Default is from CryptoProvider
Returns
Promise
<ArrayBuffer
>
getTextName()
protected
getTextName():string
Returns
string
Inherited from
getThumbprint()
Call Signature
getThumbprint(
crypto
?):Promise
<ArrayBuffer
>
Returns a SHA-1 public key thumbprint
Parameters
crypto?
Crypto
Crypto provider. Default is from CryptoProvider
Returns
Promise
<ArrayBuffer
>
Call Signature
getThumbprint(
algorithm
,crypto
?):Promise
<ArrayBuffer
>
Returns a public key thumbprint for specified mechanism
Parameters
algorithm
AlgorithmIdentifier
Hash algorithm
crypto?
Crypto
Crypto provider. Default is from CryptoProvider
Returns
Promise
<ArrayBuffer
>
onInit()
protected
onInit(asn
):void
Occurs on instance initialization
Parameters
asn
SubjectPublicKeyInfo
ASN.1 object
Returns
void
Overrides
toString()
Call Signature
toString():
string
Returns encoded object in PEM format
Returns
string
Inherited from
Call Signature
toString(
format
):string
Returns encoded object in selected format
Parameters
format
hex, base64, base64url, pem, asn, text
Returns
string
Inherited from
toTextObject()
toTextObject():
TextObject
Returns the object in textual representation
Returns
Overrides
toTextObjectEmpty()
protected
toTextObjectEmpty(value
?):TextObject
Parameters
value?
string
Returns
Inherited from
create()
static
create(data
,crypto
):Promise
<PublicKey
>
Creates a new instance from a public key data
Parameters
data
Public key data
crypto
Crypto
= ...
Crypto provider. Default is from CryptoProvider
Returns
Promise
<PublicKey
>
isAsnEncoded()
static
isAsnEncoded(data
):data is AsnEncodedType
Parameters
data
any
Returns
data is AsnEncodedType
Inherited from
toArrayBuffer()
static
toArrayBuffer(raw
):ArrayBuffer
Converts encoded raw to ArrayBuffer. Supported formats are HEX, DER, Base64, Base64Url, PEM
Parameters
raw
Encoded data
string
| BufferSource
Returns
ArrayBuffer