github.com/pion/dtls/v2@v2.2.12/internal/ciphersuite/tls_psk_with_aes_128_gcm_sha256.go (about)

     1  // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
     2  // SPDX-License-Identifier: MIT
     3  
     4  package ciphersuite
     5  
     6  import "github.com/pion/dtls/v2/pkg/crypto/clientcertificate"
     7  
     8  // TLSPskWithAes128GcmSha256 implements the TLS_PSK_WITH_AES_128_GCM_SHA256 CipherSuite
     9  type TLSPskWithAes128GcmSha256 struct {
    10  	TLSEcdheEcdsaWithAes128GcmSha256
    11  }
    12  
    13  // CertificateType returns what type of certificate this CipherSuite exchanges
    14  func (c *TLSPskWithAes128GcmSha256) CertificateType() clientcertificate.Type {
    15  	return clientcertificate.Type(0)
    16  }
    17  
    18  // KeyExchangeAlgorithm controls what key exchange algorithm is using during the handshake
    19  func (c *TLSPskWithAes128GcmSha256) KeyExchangeAlgorithm() KeyExchangeAlgorithm {
    20  	return KeyExchangeAlgorithmPsk
    21  }
    22  
    23  // ID returns the ID of the CipherSuite
    24  func (c *TLSPskWithAes128GcmSha256) ID() ID {
    25  	return TLS_PSK_WITH_AES_128_GCM_SHA256
    26  }
    27  
    28  func (c *TLSPskWithAes128GcmSha256) String() string {
    29  	return "TLS_PSK_WITH_AES_128_GCM_SHA256"
    30  }
    31  
    32  // AuthenticationType controls what authentication method is using during the handshake
    33  func (c *TLSPskWithAes128GcmSha256) AuthenticationType() AuthenticationType {
    34  	return AuthenticationTypePreSharedKey
    35  }